Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't work on Ubuntu 16.04 #46

Open
caozhenxiang-kouji opened this issue Feb 7, 2018 · 22 comments
Open

Can't work on Ubuntu 16.04 #46

caozhenxiang-kouji opened this issue Feb 7, 2018 · 22 comments

Comments

@caozhenxiang-kouji
Copy link

After value, logit, (hx, cx) = model((Variable(state.unsqueeze(0)),(hx, cx))) in train.py, the program doesn't go on. Do you have any idea?

@ikostrikov
Copy link
Owner

What version of pytorch do you use?

@caozhenxiang-kouji
Copy link
Author

The latest one, I just downloaded it from Github several hours ago. I don't know the exact version.

@ikostrikov
Copy link
Owner

Did you install it with anaconda or build from sources?

@caozhenxiang-kouji
Copy link
Author

No, just pip3 setup.py install

@caozhenxiang-kouji
Copy link
Author

There's also warnings like this one, I 'not sure if it matters.
/home/user/RL/pytorch-a3c/test.py:44: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
state.unsqueeze(0), volatile=True), (hx, cx)))

@ikostrikov
Copy link
Owner

Try to use a stable release.

They are going to introduce a lot of changes in the more recent version (the one that is currently developed in the master branch).

@caozhenxiang-kouji
Copy link
Author

Which version do you use on this project?

@ikostrikov
Copy link
Owner

0.3

@caozhenxiang-kouji
Copy link
Author

I notice that your network is different from the network from the original paper of the DeepMind. Does it work better?

@ikostrikov
Copy link
Owner

I'm using the architecture from open ai universe starter.

It works similarly. But it was easier to use it because they provide all hyper parameters.

@caozhenxiang-kouji
Copy link
Author

I can't find a 0.3 version. Does 0.2 work as well?

@ikostrikov
Copy link
Owner

Check the instructions in pytorch.org. There is 0.3 there.

@caozhenxiang-kouji
Copy link
Author

I've installed 0.3, but the problem still exists. When I change no-shared to True, the program works just fine. Do you have any idea about this?

@caozhenxiang-kouji
Copy link
Author

Have you tried training with no-shared=True? I tried it last night, but it's really hard to converge

@dragen1860
Copy link

any one tried in cuda()? I found the program stuck at x = F.elu(self.conv1(inputs))

@ikostrikov
Copy link
Owner

@dragen1860 it's designed specifically to be efficient on CPU.

For a GPU optimized code see
http://github.com/ikostrikov/pytorch-a2c-ppo-acktr

@jixian79
Copy link

i have the same problem.
Ubuntu16.04
Anaconda
pytorch0.3.1

@ShaniGam
Copy link

has anyone solved this issue?

@mynkpl1998
Copy link

@dragen1860 I was having the same problem. Adding this line in the main script solved my problem.


if __name__ == "__main__":

	mp.set_start_method("spawn")

	os.environ["OMP_NUM_THREADS"] = "1" # make sure numpy uses only one thread for each process
	os.environ["CUDA_VISABLE_DEVICES"] = "" # make sure not to use gpu

@hudsontek
Copy link

@dragen1860 I was having the same problem. Adding this line in the main script solved my problem.


if __name__ == "__main__":

	mp.set_start_method("spawn")

	os.environ["OMP_NUM_THREADS"] = "1" # make sure numpy uses only one thread for each process
	os.environ["CUDA_VISABLE_DEVICES"] = "" # make sure not to use gpu

Two years later, your answer still helps! Thanks!

@mahmudpyjs
Copy link

Can I run this code in google colab?

@akshaygulabrao
Copy link

akshaygulabrao commented Feb 6, 2023

@dragen1860 I was having the same problem. Adding this line in the main script solved my problem.


if __name__ == "__main__":

	mp.set_start_method("spawn")

	os.environ["OMP_NUM_THREADS"] = "1" # make sure numpy uses only one thread for each process
	os.environ["CUDA_VISABLE_DEVICES"] = "" # make sure not to use gpu

thank you so much, for me this only worked until I uninstalled the cuda driver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants