Open kmyfoer opened 5 years ago
I am having the same error,if you solved this please let me know.Thank you.
change:
transforms.GroupOverSample(net.input_size, net.scale_size),
to
transforms.GroupScale(net.scale_size), transforms.GroupCenterCrop(net.input_size),
@dineshp Thank you.While training the model got the following error in main.py storing name: TRN_something_RGB_BNInception_TRN_segment8
Initializing TSN with base model: BNInception.
TSN Configurations:
input_modality: RGB
num_segments: 8
new_length: 1
consensus_module: TRN
dropout_ratio: 0.8
img_feature_dim: 256
/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py:514: UserWarning: src is not broadcastable to dst, but they have the same number of elements. Falling back to deprecated pointwise behavior.
own_state[name].copy_(param)
video number:0
/usr/local/lib/python3.6/dist-packages/torchvision/transforms/transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
"please use transforms.Resize instead.")
video number:0
group: first_conv_weight has 1 params, lr_mult: 1, decay_mult: 1
group: first_conv_bias has 1 params, lr_mult: 2, decay_mult: 0
group: normal_weight has 71 params, lr_mult: 1, decay_mult: 1
group: normal_bias has 71 params, lr_mult: 2, decay_mult: 0
group: BN scale/shift has 2 params, lr_mult: 1, decay_mult: 0
Freezing BatchNorm2D except the first one.
Traceback (most recent call last):
File "main.py", line 320, in <module>
main()
File "main.py", line 128, in main
train(train_loader, model, criterion, optimizer, epoch, log_training)
File "main.py", line 161, in train
for i, (input, target) in enumerate(train_loader):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 417, in __iter__
return DataLoaderIter(self)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 242, in __init__
self._put_indices()
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 290, in _put_indices
indices = next(self.sample_iter, None)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py", line 119, in __iter__
for idx in self.sampler:
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/sampler.py", line 50, in __iter__
return iter(torch.randperm(len(self.data_source)).long())
RuntimeError: invalid argument 1: must be strictly positive at /pytorch/torch/lib/TH/generic/THTensorMath.c:2247
is there any suggestions from you? Thanks in advance
I can't figure out what happened. Is the module code not same in train model? Why only encountered this problem during the test??
Can anyone help me ? Thanks