AllenCellModeling / pytorch_fnet

Three dimensional cross-modal image inference
Other
151 stars 61 forks source link

Mismatching dimensions in download_and_train.py #167

Closed dsethz closed 4 years ago

dsethz commented 4 years ago

Description

Hi,

I just installed fnet and wanted to give the demo a try. The download works, however, in iteration 0 RuntimeError: Expected 5-dimensional input for 5-dimensional weight 32 1 3 3 3, but got 6-dimensional input of size [28, 1, 1, 32, 64, 64] instead is thrown.

Traceback results are:

Traceback (most recent call last):
  File "/home/schidani/anaconda3/envs/fnet/bin/fnet", line 8, in <module>
    sys.exit(main())
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/fnet/cli/main.py", line 39, in main
    func(args)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/fnet/cli/train_model.py", line 131, in main
    loss_train = model.train_on_batch(*bpds_train.get_batch(args.batch_size))
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/fnet/fnet_model.py", line 236, in train_on_batch
    y_hat_batch = module(x_batch)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/fnet/nn_modules/fnet_nn_3d_params.py", line 20, in forward
    x_rec = self.net_recurse(x)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/fnet/nn_modules/fnet_nn_3d_params.py", line 61, in forward
    x_2conv_more = self.sub_2conv_more(x)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/fnet/nn_modules/fnet_nn_3d_params.py", line 85, in forward
    x = self.conv1(x)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/schidani/anaconda3/envs/fnet/lib/python3.7/site-packages/torch/nn/modules/conv.py", line 480, in forward
    self.padding, self.dilation, self.groups)

Environment

- python 3.7.6
- aicsimageio 3.0.7
- pytorch 1.4.0
- cuda 10.1
- Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-65-generic x86_64)
- NVIDIA Titan RTX

Let me know if you need further information.

Best, Daniel

evamaxfield commented 4 years ago

Sorry to see you are experiencing bugs, hopefully we can figure out what is going on quickly.

Quick question: which version of aicsimageio is installed?

gregjohnso commented 4 years ago

I just pulled from master, installed on a fresh environment and couldn't reproduce the problem. @dsethz can you make sure you have the most recent version?

dsethz commented 4 years ago

Hey,

Thank you for your fast reply.

@JacksonMaxfield currently aicsimageio.__version__ = '3.0.7'.

@gregjohnso I pulled the latest version and set up a new environment, however, the issue remains.

Best, Daniel

Edit: I think I ran into some version discrepancies. I was running the release_1 branch, too and probably mixed up fnet installations. Everything is working as intended. Sorry for the inconvenience.