Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while training using notebook #7

Open
dhaniram-kshirsagar opened this issue Jan 17, 2020 · 6 comments
Open

Error while training using notebook #7

dhaniram-kshirsagar opened this issue Jan 17, 2020 · 6 comments

Comments

@dhaniram-kshirsagar
Copy link

!python run.py train -c my-config.json --cfg crnn.cfg

Compose(
ProcessChannels(mode=avg)
AdditiveNoise(prob=0.3, sig=0.001, dist_type=normal)
RandomCropLength(prob=0.4, sig=0.25, dist_type=half)
ToTensorAudio()
)
Traceback (most recent call last):
File "run.py", line 176, in
train_main(config, args.resume)
File "run.py", line 85, in train_main
model = getattr(net_module, m_name)(classes, config=config)
File "/Users/dk/projects/ns/misc_git_projects/crnn-audio-classification/net/model.py", line 29, in init
self.net = parse_cfg(config['cfg'], in_shape=[in_chan, self.spec.num_mels, 400])
File "/Users/dk/py_env/ts/lib/python3.7/site-packages/torchparse/parser.py", line 139, in parse_cfg
return CFGParser(fname).get_modules(in_shape)
File "/Users/dk/py_env/ts/lib/python3.7/site-packages/torchparse/parser.py", line 120, in get_modules
model = self._flow(in_shape)
File "/Users/dk/py_env/ts/lib/python3.7/site-packages/torchparse/parser.py", line 108, in _flow
in_shape = layer.get_out_shape()
File "/Users/dk/py_env/ts/lib/python3.7/site-packages/torchparse/base_layers.py", line 40, in get_out_shape
return torch.cat([channel, spatial])
RuntimeError: Expected object of scalar type Long but got scalar type Float for sequence element 1 in sequence argument at position #1 'tensors

@DonRichards
Copy link

Same

@Giakoumidis
Copy link

same

@physiii
Copy link

physiii commented Mar 29, 2020

Same.

Converted tensor to Long and was welcomed with new errors

@wayne391
Copy link

Hi, I got the same error before and successfully run the program by changing the Pytorch version.

conda install pytorch==1.2.0 torchvision==0.4.0 -c pytorch
pip install pillow=6.2.2

@undefinedXD
Copy link

Hi, I got the same error before and successfully run the program by changing the Pytorch version.

conda install pytorch==1.2.0 torchvision==0.4.0 -c pytorch
pip install pillow=6.2.2

it solves my problem ,thx

@ZishunYu
Copy link

ZishunYu commented Aug 18, 2020

Changing the 40th line in base_layers.py file in the torchparse package works for me.
- return torch.cat([channel, spatial])
+ return torch.cat([channel, spatial.long()])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants