问题:
(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.
问题: (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
andsavedir
inhsi_test.py
.python hsi_test.py -a trq3d -p gauss -r -rp ./checkpoints/trq3d/gauss/model_epoch_50_118454.pth --gpu-ids 0
这一步的时候出现了上面的错误,请问大佬知道这是什么原因吗?我很希望能和您交流一下,如果您方便为我提供帮助,请您加我的wx:15273115280