Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int' #81

Open
oczzz15 opened this issue Aug 2, 2023 · 0 comments

Comments

@oczzz15
Copy link

oczzz15 commented Aug 2, 2023

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant