xmengli / H-DenseUNet

TMI 2018. H-DenseUNet: Hybrid Densely Connected UNet for Liver and Tumor Segmentation from CT Volumes
526 stars 161 forks source link

Question about Training 3D Net #44

Open Charlotte0592 opened 5 years ago

Charlotte0592 commented 5 years ago

Hello, when I run CUDA_VISIBLE_DEVICES='0' python train_hybrid.py -arch 3dpart , there was a problem as the following:

Traceback (most recent call last):
      File "train_ hybrid.py". line 218, in <modules
      train_ and_ predict(args )
      File "train_ hybrid.py". line 146, in train and_ predict
      model. load_ weights (args .model_ weight, by_ name=True, by_ gpu=True, two_ model=True, by_ flag=True)File "Keras-2. 0.8/keras/engine/ topology.py" line 2621, in load_ weights
      load_ weights_ from_ hdf5_ group_ by_ name_ mulgpu_ twomodelcombine(f, self.layers, by_ flag)
      File "Keras-2 .0.8/keras/ engine/ topology.py" line 3276, in load weights_ from_ hdf5_ group_ by_ name_ mulgpu_ twomodelcombine
      f = f[' denseul6l']
      File "h5py/_ objects.pyx". line 54, in h5py._ objects .with_ phil . wrapperFile "h5py/_ objects.pyx", line 55, in h5py._ objects.with_ phil.wrapper
      File "/usr/local/lib/python2 .7/dist -packages/h5py/_ hl/group.py". line 177, in_ getitem__
      oid = h5o.open(self.id, self._ e(name), lapl=self._ lapl)
     File "h5py/_ objects.pyx", line 54, in h5py._ objects .with_ phil.wrapperFile "h5py/_ objects.pyx". line 55, in h5py._ objects .with_ phil.wrapperFile "h5py/h5o. pyx",. line 190, in h5py.h5o . open

KeyError: "Unable to open object (object ' denseul6l' doesn't exist)"

Why did this happen? How to solve it?

mnc1423 commented 5 years ago

load the weights you train from 2d

anonymously123456 commented 4 years ago

i have the same question,could you tell me the solution? thanks a lot

mnc1423 commented 4 years ago

The model can be downloaded from here:

https://drive.google.com/file/d/1HHiPBKPw539LR0Oj5g1gD3FNRkCsxeGi/view

place it in model/ directory

cheers!

anonymously123456 commented 4 years ago

thanks for you reply, I did what you said, downloaded the file and put it in model, but I still made a same mistake, do you know the reason and could you please tell me other solution? thanks so much.

Traceback (most recent call last): File "train_hybrid.py", line 218, in train_and_predict(args) File "train_hybrid.py", line 146, in train_and_predict model.load_weights(args.model_weight, by_name=True, by_gpu=True, two_model=True, by_flag=True) File "Keras-2.0.8/keras/engine/topology.py", line 2621, in load_weights load_weights_from_hdf5_group_by_name_mulgpu_twomodelcombine(f, self.layers, by_flag) File "Keras-2.0.8/keras/engine/topology.py", line 3276, in load_weights_from_hdf5_group_by_name_mulgpu_twomodelcombine f = f['denseu161'] File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "/home/wn/.conda/envs/wnpy27/lib/python2.7/site-packages/h5py/_hl/group.py", line 264, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5o.pyx", line 190, in h5py.h5o.open KeyError: "Unable to open object (object 'denseu161' doesn't exist)"

mnc1423 commented 4 years ago

If this is happening when your training the hybrid model load the weights you trained from the 2d part

python train_hybrid -model_weights /path/to/weights

Juna2 commented 4 years ago

Well, could you please tell me a new link for the model? I cannot download the model with this one. https://drive.google.com/file/d/1HHiPBKPw539LR0Oj5g1gD3FNRkCsxeGi/view