LiPang / TRQ3DNet

12 stars 3 forks source link

### 2. Testing with pretrained models Read and modify ```basefolder``` and ```savedir``` in ```hsi_test.py```. * [Blind Gaussian noise removal]: ```python hsi_test.py -a trq3d -p gauss -r -rp ./checkpoints/trq3d/gauss/model_epoch_50_118454.pth --gpu-ids 0``` #1

Open Caishen-git opened 1 year ago

Caishen-git commented 1 year ago

问题: (cyq) ubuntu18@ubuntu18:~/cyq/Model-Guided-Deep-Hyperspectral-Image-Super-resolution-main/TRQ3DNet-master$ python hsi_test.py -a trq3d -p gauss -r -rp ./checkpoints/trq3d/gauss/model_epoch_50_118454.pth --gpu-ids 0 Namespace(ImportancePath=None, arch='trq3d', beta=0.95, chop=False, clip=1000000.0, dataroot='./data/ICVL/trainset/ICVL64_31.npz', epochs=-1, gpu_ids=[0], init='kn', loss='l2', lr=0.001, no_cuda=False, no_log=True, no_ropt=True, prefix='gauss', resume=True, resumePath='./checkpoints/trq3d/gauss/model_epoch_50_118454.pth', seed=2018, slice=False, task_id=0, threads=0, valroot='./data/ICVL/valset_gauss', wd=0) Cuda Acess: 1 => creating model 'trq3d' /home/ubuntu18/.conda/envs/cyq/lib/python3.8/site-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at /opt/conda/conda-bld/pytorch_1659484810403/work/aten/src/ATen/native/TensorShape.cpp:2894.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] use init scheme: kn criterion: MSELoss() ==> Loading checkpoint... ==> Resuming from checkpoint ./checkpoints/trq3d/gauss/model_epoch_50_118454.pth.. model params: 0.68 testing ICVL_512_30.................. Traceback (most recent call last): File "hsi_test.py", line 60, in engine.test(mat_loader, savedir=savedir, filename=filename) File "/home/ubuntu18/cyq/Model-Guided-Deep-Hyperspectral-Image-Super-resolution-main/TRQ3DNet-master/hsi_setup.py", line 395, in test res_arr[batch_idx, :3] = MSIQA(outputs, targets) File "/home/ubuntu18/cyq/Model-Guided-Deep-Hyperspectral-Image-Super-resolution-main/TRQ3DNet-master/utility/eval_criterion.py", line 34, in MSIQA ssim = np.mean(cal_bwssim(X, Y)) File "/home/ubuntu18/cyq/Model-Guided-Deep-Hyperspectral-Image-Super-resolution-main/TRQ3DNet-master/utility/eval_criterion.py", line 17, in call index = self.index_fn(x, y) File "/home/ubuntu18/.conda/envs/cyq/lib/python3.8/site-packages/skimage/metrics/_structural_similarity.py", line 194, in structural_similarity raise ValueError( ValueError: Since image dtype is floating point, you must specify the data_range parameter. Please read the documentation carefully (including the note). It is recommended that you always specify the data_range anyway.

问题描述: 我在做readme里### 2. Testing with pretrained models Read and modify basefolder and savedir in hsi_test.py.

LiPang commented 7 months ago

抱歉现在才注意到。这个应该是因为你安装的skimage包的版本不一致导致的,skimage更新后似乎需要传入data_range这个参数。有两个解决方法,一种是指定data_range这个参数为0到1,另一种是降低skimage版本