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.
I replaced the line 37 bilstm_out = bilstm_out.view(bilstm_out.size(0), -1) on files BiLSTM1d.py and BiLSTM2d.py for this one bilstm_out = bilstm_out.contiguous().view(bilstm_out.size(0), -1) adding contiguous() and it has worked fine to me.
I don't know if it is the right approach, but I hope it will help.
Hi,
I hope you are doing well.
I was trying to use BiLSTM using UoC database, using the command line below:
python train.py --model_name BiLSTM1d --data_name UoC --data_dir ./Data/Mechanical-datasets --normlizetype mean-std --processing_type O_A --checkpoint_dir ./Benchmark/Benchmark_Results/Order_split/UoC/RNN_mean-std_augmentation
and I have bumped into this runtime error:
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.
I replaced the line 37
bilstm_out = bilstm_out.view(bilstm_out.size(0), -1)
on files BiLSTM1d.py and BiLSTM2d.py for this onebilstm_out = bilstm_out.contiguous().view(bilstm_out.size(0), -1)
addingcontiguous()
and it has worked fine to me.I don't know if it is the right approach, but I hope it will help.
Thanks in advance,
Carlos Lima