TobyPDE / FRRN

Full Resolution Residual Networks for Semantic Image Segmentation
MIT License
278 stars 93 forks source link

Got wrong number of dimensions exception when training #8

Closed LemonAniLabs closed 7 years ago

LemonAniLabs commented 7 years ago

Hi @TobyPDE

I can inference this network and result is good, but there are some issue in train.py

This is my log.

Using gpu device 0: GeForce GTX 970 (CNMeM is disabled, cuDNN 5005)
Enter path to CityScapes folder [DataSet/]: 
Enter model filename [models/frrn_b.npz]: 
Enter log filename [logs/frrn_b.log]: 
Define network... [0.32s]
Load model... [0.26s]
Define loss... [1.54s]
Compile update functions... [158.36s]
Compile validation function... [22.07s]
Optimize...Evaluate block 5/5
 [0.70s]
Traceback (most recent call last):
  File "train.py", line 197, in <module>
    optimizer.optimize()
  File "/home/FRRN/dltools/optimizer.py", line 55, in optimize
    losses = self.train_fn(*train_fn_args)
  File "train.py", line 140, in compute_update
    loss, grads = dltools.hybrid_training.compute_grads(grad_fns, param_blocks, *args)
  File "/home/unicornx/FRRN/dltools/hybrid_training.py", line 112, in compute_grads
    result = grad_fns[i](*args, *prev)
  File "/home/Theano/theano/compile/function_module.py", line 788, in __call__
    allow_downcast=s.allow_downcast)
  File "/home/Theano/theano/tensor/type.py", line 178, in filter
    data.shape))
TypeError: Bad input argument to theano function with name "/home/FRRN/dltools/hybrid_training.py:84" at index 1 (0-based).  
Backtrace when that variable is created:

  File "train.py", line 74, in <module>
    target_var = T.itensor3()
Wrong number of dimensions: expected 3, got 4 with shape (3, 3, 512, 1024).

Any idea? Thanks!!

TobyPDE commented 7 years ago

It looks like the images have been passed as target values. Did you edit the code?

LemonAniLabs commented 7 years ago

No, the I didn't edit the code.

TobyPDE commented 7 years ago

I can't reproduce the bug. Did you maybe modify the folder structure or naming scheme of the Cityscapes dataset?

LemonAniLabs commented 7 years ago

Hi @TobyPDE It's work now. This bug is because I create another folder in citycapes data dir,

Thanks~

TobyPDE commented 7 years ago

Thanks for letting me know.