ImCharlesY / AdaInt

[CVPR 2022] Official PyTorch Implementation of "AdaInt: Learning Adaptive Intervals for 3D Lookup Tables on Real-time Image Enhancement" (https://arxiv.org/abs/2204.13983)
Apache License 2.0
173 stars 19 forks source link

How to solve environment problem while using NVIDIA 3060 ? #17

Open JimKimHome opened 1 year ago

JimKimHome commented 1 year ago

First time I did exactly the same as the readme says,then I got capability mismatch problem. second time I reinstall pytorch==1.13 and mmv==1.7.0 and got error says I need to install mmcv>=(1, 3, 0, 0, 0, 0), <=(1, 5, 0, 0, 0, 0).

JimKimHome commented 1 year ago

first time error ``load checkpoint from local path: pretrained/AiLUT-PPR10KA-sRGB.pth The model and loaded state dict do not match exactly

missing keys in source state_dict: cnt_iters

/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/cuda/init.py:104: UserWarning: NVIDIA GeForce RTX 3060 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37. If you want to use the NVIDIA GeForce RTX 3060 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name)) Traceback (most recent call last): File "adaint/demo.py", line 75, in main() File "adaint/demo.py", line 69, in main output = enhancement_inference(model, args.img_path) File "adaint/demo.py", line 43, in enhancement_inference result = model(test_mode=True, data) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 110, in new_func return old_func(args, kwargs) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 346, in forward return self.forward_test(lq, gt, kwargs) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 395, in forwardtest output, , _ = self.forward_dummy(lq) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 321, in forward_dummy codes = self.backbone(imgs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 89, in forward return self.net(imgs).view(imgs.shape[0], -1) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torchvision/models/resnet.py", line 152, in forward x = self.relu(x) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _callimpl result = self.forward(*input, **kwargs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/activation.py", line 102, in forward return F.relu(input, inplace=self.inplace) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/functional.py", line 1204, in relu result = torch.relu(input) RuntimeError: CUDA error: no kernel image is available for execution on the device

JimKimHome commented 1 year ago

second time error: /home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/mmcv/__init__.py:21: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details. 'On January 1, 2023, MMCV will release v2.0.0, in which it will remove ' Traceback (most recent call last): File "adaint/demo.py", line 8, in <module> from mmedit.apis import init_model File "/home/zhanjinhao/codes/AdaInt/mmedit/__init__.py", line 31, in <module> f'MMCV=={mmcv.__version__} is used but incompatible. ' \ AssertionError: MMCV==1.7.1 is used but incompatible. Please install mmcv>=(1, 3, 0, 0, 0, 0), <=(1, 5, 0, 0, 0, 0).

lcwLcw123 commented 1 year ago

first time error ``load checkpoint from local path: pretrained/AiLUT-PPR10KA-sRGB.pth The model and loaded state dict do not match exactly

missing keys in source state_dict: cnt_iters

/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/cuda/init.py:104: UserWarning: NVIDIA GeForce RTX 3060 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_61 sm_70 sm_75 compute_37. If you want to use the NVIDIA GeForce RTX 3060 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/

warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name)) Traceback (most recent call last): File "adaint/demo.py", line 75, in main() File "adaint/demo.py", line 69, in main output = enhancement_inference(model, args.img_path) File "adaint/demo.py", line 43, in enhancement_inference result = model(test_mode=True, data) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 110, in new_func return old_func(args, kwargs) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 346, in forward return self.forward_test(lq, gt, kwargs) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 395, in forwardtest output, , _ = self.forward_dummy(lq) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 321, in forward_dummy codes = self.backbone(imgs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, *kwargs) File "/home/zhanjinhao/codes/AdaInt/adaint/model.py", line 89, in forward return self.net(imgs).view(imgs.shape[0], -1) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(input, kwargs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torchvision/models/resnet.py", line 152, in forward x = self.relu(x) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _callimpl result = self.forward(*input, **kwargs) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/modules/activation.py", line 102, in forward return F.relu(input, inplace=self.inplace) File "/home/zhanjinhao/anaconda3/envs/AdaInt/lib/python3.7/site-packages/torch/nn/functional.py", line 1204, in relu result = torch.relu(input) RuntimeError: CUDA error: no kernel image is available for execution on the device

I have the same problem, however, I change the code in the model.py and fixed this problem: change the original code self.register_buffer('cnt_iters', torch.zeros(1)) into 'self.cnt_iters = torch.zeros(1)'