XinJCheng / CSPN

Convolutional Spatial Propagation Network
496 stars 92 forks source link

eva_nyudepth script can not find cuda device #34

Open KimBenjaminTang opened 4 years ago

KimBenjaminTang commented 4 years ago

Hello,

I am not sure if this is an error with my setup or the code, but when I execute "bash eval_nyudepth_cspn.sh" for testing, I receive following error:

I already tested if google colab has CUDA installed and if pytorch can detect it. And even executing that line outside the script in the cell before works without any errors, but when I try to run the script, it fails.

I appreciate any help or suggestion to fix this

XinJCheng commented 4 years ago

Could you test the return value by adding "torch.cuda.is_available()" in our codes

KimBenjaminTang commented 4 years ago

Thanks for your advice, I inserted it and it returns "false". So the code can not detect it, even though it is available in the GoogleColab environment. On the left side the file with the added line can be seen.

I don't quite understand why it can not be detected in the script but in the cells before it works without any issues.

PatrykTerechowicz commented 3 years ago

I've put os.environ["CUDA_VISIBLE_DEVICES"] = '0' in beginning(after imports) of eval.py script, and put eval_error function inside: if __name__ == "__main__": eval_error()