Comments (10)
Hi,
The problem is caused by the ucf101_json.py
, which is updated now.
Could you try with the new ucf101_json.py
file? The problem should be resolved now.
Thanks.
from ccl.
Hi,
Thank you it fixed the previous issue. but now i get the following error:
No such file or directory: 'results/ucf51_ccl_ai/val.json
from ccl.
and this error during training:
File "main.py", line 569, in
main_worker(-1, opt)
File "main.py", line 516, in main_worker
train_ai_epoch(epoch=i, data_loader=train_loader, model=model, image_model=image_model,
File "/home/abhishek/abhi_scr/CCL/training.py", line 409, in train_ai_epoch
loss_vm = criterion_ct_iv(features, features_iv, targets) + criterion_ct_iv(features_iv, features, targets)
File "/home/abhishek/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/abhishek/abhi_scr/CCL/loss/nce_loss.py", line 34, in forward
log_pos_softmax = - torch.log(pred_softmax + EPISILON) * (1 - self_mask).float()
File "/home/abhishek/.local/lib/python3.8/site-packages/torch/tensor.py", line 396, in rsub
return _C._VariableFunctions.rsub(self, other)
RuntimeError: Subtraction, the -
operator, with a bool tensor is not supported. If you are trying to invert a mask, use the ~
or logical_not()
operator instead.
from ccl.
Hi,
Have you trained and tested the model successfully?
After training, there will be three log files in the folder: train.log train_batch.log val.log.
After testing, there will be a json file: val.json.
You could probably check if these files are ready to see whether the training or testing is missing. It is likely that the training or testing has not been done that caused missing the val.json
file.
from ccl.
For the training error, it is likely to be caused by pytorch version. which version is used? the default version is 1.1.0
from ccl.
and this error during training:
File "main.py", line 569, in
main_worker(-1, opt)
File "main.py", line 516, in main_worker
train_ai_epoch(epoch=i, data_loader=train_loader, model=model, image_model=image_model,
File "/home/abhishek/abhi_scr/CCL/training.py", line 409, in train_ai_epoch
loss_vm = criterion_ct_iv(features, features_iv, targets) + criterion_ct_iv(features_iv, features, targets)
File "/home/abhishek/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/abhishek/abhi_scr/CCL/loss/nce_loss.py", line 34, in forward
log_pos_softmax = - torch.log(pred_softmax + EPISILON) * (1 - self_mask).float()
File "/home/abhishek/.local/lib/python3.8/site-packages/torch/tensor.py", line 396, in rsub
return _C._VariableFunctions.rsub(self, other)
RuntimeError: Subtraction, the-
operator, with a bool tensor is not supported. If you are trying to invert a mask, use the~
orlogical_not()
operator instead.
the nce_loss.py
file is updated, which could probably allow working in a newer PyTorch version.
from ccl.
Many Thanks. the problem with pytorch version still persist but I should be able to fix it as we know it is becuase of pytorch version.
from ccl.
Training code runs after downgrading the pytorch to 1.1.0. thanks
from ccl.
and this error during training:
File "main.py", line 569, in
main_worker(-1, opt)
File "main.py", line 516, in main_worker
train_ai_epoch(epoch=i, data_loader=train_loader, model=model, image_model=image_model,
File "/home/abhishek/abhi_scr/CCL/training.py", line 409, in train_ai_epoch
loss_vm = criterion_ct_iv(features, features_iv, targets) + criterion_ct_iv(features_iv, features, targets)
File "/home/abhishek/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/abhishek/abhi_scr/CCL/loss/nce_loss.py", line 34, in forward
log_pos_softmax = - torch.log(pred_softmax + EPISILON) * (1 - self_mask).float()
File "/home/abhishek/.local/lib/python3.8/site-packages/torch/tensor.py", line 396, in rsub
return _C._VariableFunctions.rsub(self, other)
RuntimeError: Subtraction, the-
operator, with a bool tensor is not supported. If you are trying to invert a mask, use the~
orlogical_not()
operator instead.
Hi.
The error stems from the compatibility of boolean operation for each pytorch version.
For the newer version of Pytorch, we can simply change the lines of nce_loss.py
code as follow to run.
Line 34
log_pos_softmax = - torch.log(pred_softmax + EPISILON) * (1 - self_mask.float())
to
log_pos_softmax = - torch.log(pred_softmax + EPISILON) * ((~self_mask).float())
and
Line 36
log_softmax = log_pos_softmax.sum(1) / (1 - self_mask).sum(1).float() + log_neg_softmax.sum(1) / self_mask.sum(1).float()
to
log_softmax = log_pos_softmax.sum(1) / (~self_mask).sum(1).float() + log_neg_softmax.sum(1) / self_mask.sum(1).float()
Please correct me if anything wrong :)
from ccl.
Thanks for pointing it out. It looks correct to me.
from ccl.
Related Issues (8)
- code HOT 1
- Cannot find v_HandStandPushups_g08_c01.hdf5 HOT 1
- Hardware requirements for training? HOT 4
- RuntimeError: Given input size: (512x4x4). Calculated output size: (512x-2x-2). Output size is too smal│ l at /pytorch/aten/src/THCUNN/generic/SpatialAveragePooling.cu:47 HOT 1
- Pretrained Models
- ValueError: num_samples should be a positive integer value, but got num_samples=0
- write_to_epoch_logger() mistake?This should be placed outside the for loop.
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 ccl.