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

hidden_states_list error #4

Open
mrsahabu opened this issue Dec 23, 2019 · 0 comments
Open

hidden_states_list error #4

mrsahabu opened this issue Dec 23, 2019 · 0 comments

Comments

@mrsahabu
Copy link

Hi, while training I am getting this error.

(lstm) D:\LSTM Object Detection>python train_ssd.py
2019-12-23 16:37:41,477 - root - INFO - cuda
2019-12-23 16:37:41,478 - root - INFO - Use GPU
2019-12-23 16:37:41,478 - root - INFO - Namespace(balance_data=False, base_net=None, base_net_lr=None, batch_size=2, checkpoint_folder='models/', dataset_type='voc', datasets='./data', debug_steps=1, extra_layers_lr=None, freeze_base_net=False, freeze_net=False, gamma=0.1, lr=0.001, mb2_width_mult=1.0, milestones='80,100', momentum=0.9, net='vgg16-ssd', num_epochs=200, num_workers=0, pretrained_ssd=None, resume=None, scheduler='multi-step', t_max=120, use_cuda=True, validation_dataset=None, validation_epochs=5, weight_decay=0.0005)
2019-12-23 16:37:41,480 - root - INFO - Prepare training datasets.
2019-12-23 16:37:41,481 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,481 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,482 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,483 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,483 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,484 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,484 - root - INFO - Stored labels into file D:\LSTM Object Detection\labels.txt.
2019-12-23 16:37:41,485 - root - INFO - Train dataset size: 18
2019-12-23 16:37:41,485 - root - INFO - Prepare Validation datasets.
2019-12-23 16:37:41,485 - root - INFO - No labels file, using default VOC classes.
2019-12-23 16:37:41,485 - root - INFO - validation dataset size: 3
2019-12-23 16:37:41,485 - root - INFO - Build network.
2019-12-23 16:37:42,800 - root - INFO - Took 0.00 seconds to load the model.
2019-12-23 16:37:45,074 - root - INFO - Learning rate: 0.001, Base net learning rate: 0.001, Extra Layers learning rate: 0.001.
2019-12-23 16:37:53,236 - root - INFO - Uses MultiStepLR scheduler.
2019-12-23 16:37:53,238 - root - INFO - Start training from epoch 0.
Traceback (most recent call last):
  File "train_ssd.py", line 381, in <module>
    device=DEVICE, debug_steps=args.debug_steps, epoch=epoch)
  File "train_ssd.py", line 154, in train
    hidden_states_list, confidence, locations = net(video, hidden_states_list)
  File "C:\Users\abdul.ahad\AppData\Local\Continuum\anaconda3\envs\lstm\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\LSTM Object Detection\vision\ssd\ssd.py", line 148, in forward
    state = self.LSTM_list[i](y, hidden_states[i])
  File "C:\Users\abdul.ahad\AppData\Local\Continuum\anaconda3\envs\lstm\lib\site-packages\torch\nn\modules\module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\LSTM Object Detection\vision\nn\conv_lstm.py", line 41, in forward
    stacked_inputs = torch.cat((input_, prev_hidden), 1)
RuntimeError: Expected object of backend CUDA but got backend CPU for sequence element 1 in sequence argument at position #1 'tensors'

While this was working on CPU. I have changed hidden_states_list to tensor.zeros but then got TypeError: iteration over a 0-d tensor.
Versions pytorch = 1.0.0 Cuda = 9.2 python 3

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

1 participant