Zj-BinXia / SSL

This project is the official implementation of 'Structured Sparsity Learning for Efficient Video Super-Resolution', CVPR2023
95 stars 6 forks source link

Cannot perform test script #1

Open onurbarut opened 1 year ago

onurbarut commented 1 year ago

Hi, I've single gpu, but test script doesn't work. I tested with REDS data and here is the issue that I faced but couldn't solve:

load path .......... Traceback (most recent call last): File "/home/onur/AIME/SSL/basicsr/test_prune_l1.py", line 53, in test_pipeline(root_path) File "/home/onur/AIME/SSL/basicsr/test_prune_l1.py", line 43, in test_pipeline model.load_prune(args,opt) File "/home/onur/AIME/SSL/basicsr/models/video_recurrent_prune_model.py", line 245, in load_prune prune_info = torch.load(load_path) File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 607, in load return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args) File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 882, in _load result = unpickler.load() File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 857, in persistent_load load_tensor(data_type, size, key, _maybe_decode_ascii(location)) File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 846, in load_tensor loaded_storages[key] = restore_location(storage, location) File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 175, in default_restore_location result = fn(storage, location) File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 151, in _cuda_deserialize device = validate_cuda_device(location) File "/home/onur/anaconda3/envs/SSL/lib/python3.9/site-packages/torch/serialization.py", line 142, in validate_cuda_device raise RuntimeError('Attempting to deserialize object on CUDA device ' RuntimeError: Attempting to deserialize object on CUDA device 1 but torch.cuda.device_count() is 1. Please use torch.load with map_location to map your storages to an existing device. (SSL) onur@CYP-tahani-20-5:~/AIME/SSL$

I tried num_gpus 0 both in yml and test script, but same error persists. thanks.

Zj-BinXia commented 1 year ago

Hi, It seems that your environment is not suitable. you can try to use PyTorch: 1.10.0+cuda113

onurbarut commented 1 year ago

Hi, I've set conda env with pyhton=3.8 and installed pytorch 1.10.0 + cuda113 as here: https://pytorch.org/get-started/previous-versions/#:~:text=cudatoolkit%3D10.2%20%2Dc%20pytorch-,%23%20CUDA%2011.3,-conda%20install%20pytorch%3D%3D1.10.0

but same problem persists :(.

XiaoKuwa commented 1 year ago

Hello, have you solved this problem? I also encountered the same problem.

onurbarut commented 1 year ago

Unfortunately no, I wasn't able to fix. I stopped spending time on it.

Zj-BinXia commented 1 year ago

you should run scripts at environments:
BasicSR: 1.3.5 PyTorch: 1.10.0+cu113 TorchVision: 0.11.1+cu113

XiaoKuwa commented 1 year ago

Thank you! I can test it successfully now!