After fixing some trivial bugs in the code that deal with expand_as, I get an error thrown:
[2017-07-30 21:27:20,583] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,900] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,905] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,915] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,922] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,933] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,938] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,950] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,950] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,982] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,973] Making new env: PongDeterministic-v4
[2017-07-30 21:27:20,999] Making new env: PongDeterministic-v4
[2017-07-30 21:27:21,022] Making new env: PongDeterministic-v4
[2017-07-30 21:27:21,029] Making new env: PongDeterministic-v4
[2017-07-30 21:27:21,073] Making new env: PongDeterministic-v4
[2017-07-30 21:27:21,077] Making new env: PongDeterministic-v4
[2017-07-30 21:27:21,107] Making new env: PongDeterministic-v4
[2017-07-30 21:27:21,122] Making new env: PongDeterministic-v4
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called recursively
terminate called after throwing an instance of ‘std::runtime_error’
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called recursively
terminate called after throwing an instance of ‘std::runtime_error’
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
terminate called after throwing an instance of ‘std::runtime_error’
what(): CUDA error (3): initialization error
The code I am referencing does not make any calls to CUDA, so why would I be getting this error?
The same error. Have you found the solution? It is strange that when I run the same python script on another computer with the same configuration(CUDA8.0 + CUDNN6 + Python2.7, but different OS: Ubuntu14.04 vs Ubuntu16.04), it works well.
Emm… I have solved the problem. Are you using the latest version (0.2.0)? I went back to version 0.1.12, and the problem is fixed. I think maybe it is a bug.
I think this can be solved by setting mp.set_start_method('spawn') before any cuda call (including setting the rng, for example) when dealing with cuda share_memory objects.
If not familiar with Git, you can just go to this website: https://github.com/pytorch/pytorch/releases to download v0.1.12 source code and build pytorch from scratch following the instructions provided in README of pytorch’s repo.
I am sure torch.multiprocessing has this method implemented. Maybe you are on an OS other than Linux and the method is not implemented in python’s multiprocessing in the first place?