报错:
Traceback (most recent call last):File "topFAR_COX_py2_fc1_pytorch_PY3.py", line 199, in <module>IDimage_features_dict = getfeatures_dict(model, IDimage_list, IDimage_path, featurelen)File "topFAR_COX_py2_fc1_pytorch_PY3.py", line 106, in getfeatures_dictemb = extractfeature(model, oriimg)File "/home/user1/miniconda3/envs/py377/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_contextreturn func(*args, **kwargs)File "topFAR_COX_py2_fc1_pytorch_PY3.py", line 60, in extractfeatureimg = torch.Tensor(img).cuda()
ValueError: too many dimensions 'NDArray'
解决:
img = torch.Tensor(img.asnumpy()).cuda()