Git Product home page Git Product logo

Comments (3)

matyasbohacek avatar matyasbohacek commented on September 28, 2024

Hi @adhithiyaa-git,

It seems that wou are training the WLASL100 dataset (with 100 classes) but only using the default --num_classes argument, which is 64. This would cause the IndexError.

Try adding --num_classes 100 to your training command and please let me know if this helps.

from spoter.

rhngpt avatar rhngpt commented on September 28, 2024

Hi,
I was getting the same problem, and I saw this question. I tried adding the --num_classes 100 but I got another error.

The command I used to train the model:

python -m train --experiment_name trial --epochs 1 --training_set_path "C:\Users\Asus\Documents\Lecture Notes\Intro to Artificial Intelligence\spoter-main\datasets\WLASL100_train_25fps.csv" --validation_set_path "C:\Users\Asus\Documents\Lecture Notes\Intro to Artificial Intelligence\spoter-main\datasets\WLASL100_val_25fps.csv" --testing_set_path "C:\Users\Asus\Documents\Lecture Notes\Intro to Artificial Intelligence\spoter-main\datasets\WLASL100_test_25fps.csv" --num_classes 100

The error:

Starting trial...

Traceback (most recent call last):
File "C:\Users\Asus\anaconda3\envs\CS5804_AI\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Asus\anaconda3\envs\CS5804_AI\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Asus\Documents\Lecture Notes\Intro to Artificial Intelligence\spoter-main\train.py", line 271, in
train(args)
File "C:\Users\Asus\Documents\Lecture Notes\Intro to Artificial Intelligence\spoter-main\train.py", line 174, in train
train_loss, _, _, train_acc = train_epoch(slrt_model, train_loader, cel_criterion, sgd_optimizer, device)
File "C:\Users\Asus\Documents\Lecture Notes\Intro to Artificial Intelligence\spoter-main\spoter\utils.py", line 19, in train_epoch
loss = criterion(outputs[0], labels[0])
File "C:\Users\Asus\anaconda3\envs\CS5804_AI\lib\site-packages\torch\nn\modules\module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "C:\Users\Asus\anaconda3\envs\CS5804_AI\lib\site-packages\torch\nn\modules\loss.py", line 1047, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "C:\Users\Asus\anaconda3\envs\CS5804_AI\lib\site-packages\torch\nn\functional.py", line 2693, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "C:\Users\Asus\anaconda3\envs\CS5804_AI\lib\site-packages\torch\nn\functional.py", line 2388, in nll_loss
ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
IndexError: Target -1 is out of bounds.

from spoter.

andresherrera97 avatar andresherrera97 commented on September 28, 2024

Issue is solved with the change proposed in this comment from another issue thread
#2 (comment)

from spoter.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.