MedicalNet
MedicalNet copied to clipboard
你好,我在测试的时候出现了一个问题,请问您知道这是为什么吗
(MedicalNet) xinyu@xinyu-MS-7B89:~/MedicalNet-master$ python test.py --gpu_id 0 --resume_path trails/models/resnet_50_epoch_199_batch_0.pth.tar --img_list data/val.txt
/home/xinyu/MedicalNet-master/models/resnet.py:173: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_.
m.weight = nn.init.kaiming_normal(m.weight, mode='fan_out')
Processing 1 datas
/home/xinyu/MedicalNet-master/data/MRBrainS18/images/imaging4.nii.gz
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCGeneral.cpp line=383 error=11 : invalid argument
Traceback (most recent call last):
File "test.py", line 92, in
File "test.py", line 67, in test mask = ndimage.interpolation.zoom(mask, scale, order=1)
Shold be replaced by
mask = ndimage.interpolation.zoom(mask.cpu(), scale, order=1)
cause the mask is in GPU by default.
I met the same problem. Use mask = mask.cpu() will solve it.