Comments (3)
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.
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.
Issue is solved with the change proposed in this comment from another issue thread
#2 (comment)
from spoter.
Related Issues (13)
- Thank your work.Please comment,report an error when training,lack CSLRTransformer() this model. HOT 1
- Training on new data HOT 1
- How to calculate validation loss when training? HOT 1
- about position embedding
- traning new data
- Thank for your work! Please comment,when training ,report another error. HOT 5
- Problematic normalization HOT 7
- Pose based GRU model
- Testing new data
- training new data HOT 9
- training new data HOT 2
- CUDA error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spoter.