You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was able to run train.py and save_features.py successfully, but encountered an issue when running test.py (using Python 3.10 and PyTorch 2.0). The error message is as follows:
Traceback (most recent call last):
File "D:\CloserLookFewShot-master\test.py", line 155, in
acc = feature_evaluation(cl_data_file, model, n_query=15, adaptation=params.adaptation, **few_shot_params)
File "D:\CloserLookFewShot-master\test.py", line 41, in feature_evaluation
scores = model.set_forward(z_all, is_feature=True)
File "D:\CloserLookFewShot-master\methods\baselinefinetune.py", line 15, in set_forward
return self.set_forward_adaptation(x,is_feature) # Baseline always do adaptation
File "D:\CloserLookFewShot-master\methods\baselinefinetune.py", line 48, in set_forward_adaptation
loss = loss_function(scores,y_batch)
File "C:\Users\tangs\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\tangs\miniconda3\lib\site-packages\torch\nn\modules\loss.py", line 1174, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "C:\Users\tangs\miniconda3\lib\site-packages\torch\nn\functional.py", line 3029, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int'
The text was updated successfully, but these errors were encountered:
I was able to run train.py and save_features.py successfully, but encountered an issue when running test.py (using Python 3.10 and PyTorch 2.0). The error message is as follows:
Traceback (most recent call last):
File "D:\CloserLookFewShot-master\test.py", line 155, in
acc = feature_evaluation(cl_data_file, model, n_query=15, adaptation=params.adaptation, **few_shot_params)
File "D:\CloserLookFewShot-master\test.py", line 41, in feature_evaluation
scores = model.set_forward(z_all, is_feature=True)
File "D:\CloserLookFewShot-master\methods\baselinefinetune.py", line 15, in set_forward
return self.set_forward_adaptation(x,is_feature) # Baseline always do adaptation
File "D:\CloserLookFewShot-master\methods\baselinefinetune.py", line 48, in set_forward_adaptation
loss = loss_function(scores,y_batch)
File "C:\Users\tangs\miniconda3\lib\site-packages\torch\nn\modules\module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "C:\Users\tangs\miniconda3\lib\site-packages\torch\nn\modules\loss.py", line 1174, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "C:\Users\tangs\miniconda3\lib\site-packages\torch\nn\functional.py", line 3029, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int'
The text was updated successfully, but these errors were encountered: