nmi-lab / decolle-public

GNU General Public License v3.0
41 stars 22 forks source link

Confused type error in code (Sep. 2) #1

Closed hewh16 closed 4 years ago

hewh16 commented 4 years ago

Hi~ I am a student of Tsinghua University and is trying to test dvs_gesture dataset. Hoping that I could get some help from the repo. I tested the code(Sep.2 version). Everything goes well until the epoch 1 finished. It shows:

Saving results to runs_args_lenet_decolle_cuda/Nov01_21-23-02_seallab-Precision-Tower-7910_bioplaus /home/hewh16/master/decolle/utils.py:70: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. params = yaml.load(f) File data/dvs_gestures_events.hdf5 exists: not re-converting DvsGesture

------Starting training with 3 DECOLLE layers------- Epoch 0: 100%|███████████████████████████████████████████████████████████| 500/500 [00:06<00:00, 75.84it/s] Loss 2.43e+04 ---------------Epoch 1------------- ---------Saving checkpoint--------- Traceback (most recent call last): File "train_lenet_decolle.py", line 94, in test_loss, test_acc = test(gen_test, loss, net, params['burnin_steps'], print_error = True) File "/home/hewh16/master/decolle/utils.py", line 108, in test net.init(data_batch, burnin) File "/home/hewh16/master/decolle/base_model.py", line 266, in init self.forward(torch.Tensor(data_batch[:, i, :, :]).to(device)) File "/home/hewh16/master/decolle/lenet_decolle_model.py", line 129, in forward u_p = pool(u) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/nn/modules/pooling.py", line 141, in forward self.return_indices) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/_jit_internal.py", line 138, in fn return if_false(args, **kwargs) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/nn/functional.py", line 488, in _max_pool2d input, kernel_size, stride, padding, dilation, ceil_mode) RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4

Sound unbelievable confusing :( I will appreciate it if you could help me out. By the way, if that seems hard, could you please just show me a simple demo of mlp test on dvs_gesture? Thanks~

eneftci commented 4 years ago

Hi Weihua,

Can you attach your yaml config file as well?

On Sat, Nov 2, 2019, at 5:46 AM, Weihua He wrote:

Hi~ I am a student of Tsinghua University and is trying to test dvs_gesture dataset. Hoping that I could get some help from the repo. I tested the code(Sep.2 version). Everything goes well until the epoch 1 finished. It shows:

Saving results to runs_args_lenet_decolle_cuda/Nov01_21-23-02_seallab-Precision-Tower-7910_bioplaus /home/hewh16/master/decolle/utils.py:70: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. params = yaml.load(f) File data/dvs_gestures_events.hdf5 exists: not re-converting DvsGesture

------Starting training with 3 DECOLLE layers------- Epoch 0: 100%|███████████████████████████████████████████████████████████| 500/500 [00:06<00:00, 75.84it/s] Loss 2.43e+04 ---------------Epoch 1------------- ---------Saving checkpoint--------- Traceback (most recent call last): File "train_lenet_decolle.py", line 94, in test_loss, test_acc = test(gen_test, loss, net, params['burnin_steps'], print_error = True) File "/home/hewh16/master/decolle/utils.py", line 108, in test net.init(data_batch, burnin) File "/home/hewh16/master/decolle/base_model.py", line 266, in init self.forward(torch.Tensor(data_batch[:, i, :, :]).to(device)) File "/home/hewh16/master/decolle/lenet_decolle_model.py", line 129, in forward u_p = pool(u) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/nn/modules/module.py", line 541, in call result = self.forward(*input, *kwargs) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/nn/modules/pooling.py", line 141, in forward self.return_indices) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/_jit_internal.py", line 138, in fn return if_false(args, **kwargs) File "/home/hewh16/miniconda3/envs/hewh16/lib/python3.7/site-packages/torch/nn/functional.py", line 488, in _max_pool2d input, kernel_size, stride, padding, dilation, ceil_mode) RuntimeError: non-empty 3D or 4D input tensor expected but got ndim: 4

Sound unbelievable confusing :( I will appreciate it if you could help me out. By the way, if that seems hard, could you please just show me a simple demo of mlp test on dvs_gesture? Thanks~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nmi-lab/decolle-public/issues/1?email_source=notifications&email_token=AAOOH2YW22POFXDN4EJTEA3QRUA2JA5CNFSM4JICX522YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWIYKSA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOH23H7HFM52FCTT2LHALQRUA2JANCNFSM4JICX52Q.

-- Emre Neftci, PhD, Assistant Professor, Neuromorphic Machine Intelligence Lab (http://nmi-lab.org/), Department of Cognitive Sciences, 2308 Social & Behavioral Sciences Gateway Building, UC Irvine 92697-5100

hewh16 commented 4 years ago

Hi Weihua, Can you attach your yaml config file as well?

The yaml config files are the same as the code of Sep. 2.. I don't make any change of them. You can find the version I used in commit(Sep.2). Thanks :)

hewh16 commented 4 years ago

Hi Eon,

I guess the bug is in function next_1ofeach(). Because when I canceled the choice of "train" and "test" in function next() of class SequenceGenerator (in load_dvsgesture_sparse.py), the code went well. It may help you:)

hewh16 commented 4 years ago

BTW, there is no load_dvsgestures_sparse in current version. So I could not demo the current code(lol). I guess it might be easier for you to fix the current version. :)

All I need is a runnable demo...Thanks:)

eneftci commented 4 years ago

Ok I'll let you know i add it. It might be in github repo nmi-lab/dcll in the meantime

On Sat, Nov 2, 2019, at 10:49 AM, Weihua He wrote:

BTW, there is no load_dvsgestures_sparse in current version. So I could not demo the current code(lol). I guess it might be easier for you to fix the current version. :)

All I need is a runnable demo...Thanks:)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nmi-lab/decolle-public/issues/1?email_source=notifications&email_token=AAOOH27TPPAOZUYA4OVTNODQRVEK5A5CNFSM4JICX522YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC4YDVY#issuecomment-549028311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOOH24WT3SESGJY2QHTBPLQRVEK5ANCNFSM4JICX52Q.

-- Emre Neftci, PhD, Assistant Professor, Neuromorphic Machine Intelligence Lab (http://nmi-lab.org/), Department of Cognitive Sciences, 2308 Social & Behavioral Sciences Gateway Building, UC Irvine 92697-5100

hewh16 commented 4 years ago

Ok I'll let you know i add it. It might be in github repo nmi-lab/dcll in the meantime

Thanks:) Now I can run the demo. I'm now preparing a paper for Frontiers in Neuroscience, and will cite your work if it could be published.