kenziyuliu / DGNN-PyTorch

Unofficial PyTorch implementation of the CVPR'19 paper "Skeleton-Based Action Recognition with Directed Graph Neural Networks".
Other
235 stars 59 forks source link

Problem with fv.view(N, -1, V_node) function in dggn.py #20

Closed Eryk07 closed 4 years ago

Eryk07 commented 4 years ago

Hello, I'm getting the following error while trying to run model training, with part of NTU RGB+D dataset:

Model total number of params: 4089320
[ Fri Feb 21 11:48:03 2020 ] Parameters:
{'work_dir': './work_dir/ntu/xsub/dgnn_spatial', 'model_saved_name': './runs/ntu_cs_dgnn_spatial', 'config': './config/nturgbd-cross-subject/train_spatial.yaml', 'phase': 'train', 'save_score': False, 'seed': 1, 'log_interval': 100, 'save_interval': 2, 'eval_interval': 5, 'print_log': True, 'show_topk': [1, 5], 'feeder': 'feeders.feeder.Feeder', 'num_worker': 64, 'train_feeder_args': {'joint_data_path': './data/ntu/xsub/train_data_joint.npy', 'bone_data_path': './data/ntu/xsub/train_data_bone.npy', 'label_path': './data/ntu/xsub/train_label.pkl', 'debug': False, 'random_choose': False, 'random_shift': False, 'random_move': False, 'window_size': -1, 'normalization': False}, 'test_feeder_args': {'joint_data_path': './data/ntu/xsub/val_data_joint.npy', 'bone_data_path': './data/ntu/xsub/val_data_bone.npy', 'label_path': './data/ntu/xsub/val_label.pkl'}, 'model': 'model.dgnn.Model', 'model_args': {'num_class': 60, 'num_point': 25, 'num_person': 2, 'graph': 'graph.directed_ntu_rgb_d.Graph'}, 'weights': None, 'ignore_weights': [], 'base_lr': 0.1, 'step': [60, 90], 'device': [0], 'optimizer': 'SGD', 'nesterov': True, 'batch_size': 1, 'test_batch_size': 1, 'start_epoch': 0, 'num_epoch': 60, 'weight_decay': 0.0005, 'freeze_graph_until': 10}
[ Fri Feb 21 11:48:03 2020 ] Training epoch: 1
[ Fri Feb 21 11:48:03 2020 ] Graphs are frozen at epoch 1
  0%|          | 0/60 [00:00<?, ?it/s]Traceback (most recent call last):
  File "D:/dev/DGNN-PyTorch/main.py", line 606, in <module>
    processor.start()
  File "D:/dev/DGNN-PyTorch/main.py", line 550, in start
    self.train(epoch, save_model=save_model)
  File "D:/dev/DGNN-PyTorch/main.py", line 398, in train
    output = self.model(batch_joint_data, batch_bone_data)
  File "D:\dev\DGNN-PyTorch\venv\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\dev\DGNN-PyTorch\model\dgnn.py", line 184, in forward
    fv, fe = self.l2(fv, fe)
  File "D:\dev\DGNN-PyTorch\venv\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\dev\DGNN-PyTorch\model\dgnn.py", line 123, in forward
    fv, fe = self.dgn(fv, fe)
  File "D:\dev\DGNN-PyTorch\venv\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "D:\dev\DGNN-PyTorch\model\dgnn.py", line 85, in forward
    fv = fv.view(N, -1, V_node)
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
  0%|          | 0/60 [00:57<?, ?it/s]
Process finished with exit code 1

Is it problem with PyTorch version (I'm using 1.4.0) or may it be problem with size of dataset? I've tried to load the whole dataset, but then I have another issue with too big size of data.

Anirudh257 commented 4 years ago

This seems to be a problem with Pytorch version. Use Pytorch version: 1.3.1

Eryk07 commented 4 years ago

Yeah it worked, thanks

latlongheight commented 3 years ago

This seems to be a problem with Pytorch version. Use Pytorch version: 1.3.1

Hi, I'm facing the same error message at the moment, just wondering if you still remember how to install Pytorch1.3.1? Because I can't seem to find the solution on line. Thanks.

Anirudh257 commented 3 years ago

@latlongheight You can do pip install torch==1.3.1 by following this link

latlongheight commented 3 years ago

@latlongheight You can do pip install torch==1.3.1 by following this link

I'll try that, thank you