yulunzhang / RCAN

PyTorch code for our ECCV 2018 paper "Image Super-Resolution Using Very Deep Residual Channel Attention Networks"
1.37k stars 311 forks source link

Fix for Incompatible version with pytorch 1.0 #30

Open darylfung96 opened 5 years ago

darylfung96 commented 5 years ago

For anyone who encounters a problem when using pytorch 1.0. saying that _worker_manager_loop is not found. There is also a same issue occuring in proSR repository. You can find the issue here: https://github.com/fperazzi/proSR/issues/31 . This issue tells us to change _worker_memory_loop to _pin_memory_loop to fix the problem.

There are some additional steps that need to be change after changing from _worker_manager_loop to _pin_memory_loop.

go to code/dataloader.py and change: self.worker_result_queue = multiprocessing.SimpleQueue() to self.worker_result_queue = multiprocessing.Queue()

then change: self.worker_manager_thread = threading.Thread( target=_worker_manager_loop, args=(self.worker_result_queue, self.data_queue, self.done_event, self.pin_memory, maybe_device_id)) self.worker_manager_thread.daemon = True self.worker_manager_thread.start() to self.pin_memory_thread = threading.Thread( target=_pin_memory_loop, args=(self.worker_result_queue, self.data_queue, maybe_device_id, self.done_event )) self.pin_memory_thread.daemon = True self.pin_memory_thread.start()

yulunzhang commented 5 years ago

Thanks

yulunzhang commented 5 years ago

hi

please refer to https://github.com/thstkdgus35/EDSR-PyTorch/commit/565d6feaf58616558fb01a0c65342c01a3b3a26f