facebookresearch / deepcluster

Deep Clustering for Unsupervised Learning of Visual Features
Other
1.69k stars 325 forks source link

RuntimeError: invalid argument 5: k not in range for dimension at /pytorch/aten/src/THC/generic/THCTensorTopK.cu:23 #77

Closed onishimal99 closed 4 years ago

onishimal99 commented 4 years ago
Traceback (most recent call last):
  File "eval_linear.py", line 325, in <module>
    main()
  File "eval_linear.py", line 140, in main
    train(train_loader, model, reglog, criterion, optimizer, epoch)
  File "eval_linear.py", line 251, in train
    prec1, prec5 = accuracy(output.data, target, topk=(1, 5))
  File "eval_linear.py", line 213, in accuracy
    _, pred = output.topk(maxk, 1, True, 

RuntimeError: invalid argument 5: k not in range for dimension at /pytorch/aten/src/THC/generic/THCTensorTopK.cu:23

When I run ./eval_linear.sh,this error was returned.

Does anyone have any ideas on this issue?

DDxk369 commented 3 years ago

The same problem also happened to me. Have you solved it?

KuntimaKiala commented 2 years ago

For those who found the same problem as me, you have to reduce the maxk