fuy34 / superpixel_fcn

[CVPR‘20] SpixelFCN: Superpixel Segmentation with Fully Convolutional Network
Other
392 stars 80 forks source link

raise RuntimeError('Attempting to deserialize object on a CUDA #41

Closed Adnan1986 closed 1 year ago

Adnan1986 commented 1 year ago

Hi,

Thank you for sharing your works. I have tried to run your code in (cuda 9.1, pytorch 1.4, conda environment on windows). When runing the demo I got following error, while I am using cuda device and return TRUE in python. Is there a way to fix it?

image

Thanks

fuy34 commented 1 year ago

Hi, Thank you for your interest in our work.

I do not have a windows machine to reproduce this issue. Have you tried it on a Linux machine?

A few possible ways to fix this:

  1. set os.environ['CUDA_VISIBLE_DEVICES'] = '0' if you only have one GPU on the machine https://github.com/fuy34/superpixel_fcn/blob/ae81e171a64dc9ed26a039a1a52b87b5fe744cf1/run_demo.py#L35
  2. change all .cuda() to .cpu() in the .py file
  3. install the Linux environment using WSL on windows

Hope it helps.

Adnan1986 commented 1 year ago

Hi, Thank you for your interest in our work.

I do not have a windows machine to reproduce this issue. Have you tried it on a Linux machine?

A few possible ways to fix this:

  1. set os.environ['CUDA_VISIBLE_DEVICES'] = '0' if you only have one GPU on the machine https://github.com/fuy34/superpixel_fcn/blob/ae81e171a64dc9ed26a039a1a52b87b5fe744cf1/run_demo.py#L35
  2. change all .cuda() to .cpu() in the .py file
  3. install the Linux environment using WSL on windows

Hope it helps.

Thank you. Your 1st solution have worked.

Just one more things, how many epochs are sufficient for training. I am going to use your result for comparison with other algorithms, so I want to have a fair comparison. In additions, since to install cuda 9, I have used an old gpu, so training could take much time and 300K as a default could be a lot