-
Notifications
You must be signed in to change notification settings - Fork 174
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
RuntimeError: CUDA error: invalid device ordinal with starry_stanford.sh #70
Comments
First you should check if PyTorch sees your devices correctly and that CUDA works. Try running this in the Python interpreter and seeing what it shows:
If the devices exist and CUDA works, then it's probably just an issue with the ID you are using. CUDA can sometimes be a bit weird with how it sets GPU IDs: https://stackoverflow.com/questions/13781738/how-does-cuda-assign-device-ids-to-gpus You fix the GPU device order by
You can also use
|
ahh.. never knew that about PyTorch, it seems that the device id's compared to what nvidia-smi are swapped.
hmm so in my case adding maybe this. CUDA_DEVICE_ORDER=0 python3 neural_style.py would be the 1060, and CUDA_DEVICE_ORDER=1 python3 neural_style.py should be the 1080? should I make any changed to the GPU value in the script? Thanks for your timely response.. btw has anyone used your version of style transfer for video? |
The invalid device ordinal is error is normally given when you specify a non existent GPU ID. The GPU value in the script should be set to the PyTorch GPU ID that you want to use as PyTorch shows the device you want to use as having an ID of
Yes, but those individuals tend to use techniques like rotoscoping to create video to avoid the flicking effect. I'm not knowledgeable enough yet to translate artistic-videos to PyTorch. But it should easier for someone who better understands the video aspect of the code, as both artistic-videos and neural-style-pt are based on the same original code (neural-style). |
Basically this is what neural-style-pt does with GPU IDs (example with the Python Interpreter):
When I specify a valid GPU, I get something like this:
And when I specify a GPU that doesn't exist on my computer, I get this:
|
Hi, I'm trying to run the script above to see if my system can handle and create larger images based upon your script.
I added -optimizer adam and using the NIN model for lower memory gpus.
Here is my output that fails eventually...
https://github.com/ProGamerGov/neural-style-pt/blob/master/examples/scripts/starry_stanford.sh
Nvidia info
btw I'm using GPU 1 since it has the most memory and not using the primary display..
thoughts?
The text was updated successfully, but these errors were encountered: