Closed PoonamZ closed 6 years ago
the file ResUnet.04_0.646.hdf5
is the pretrained weights that the model tries to load to resume a previous training, if you want to train it from scratch replace line 104 in train.py
with model_to_load=None
.
thank you.
@Issam28 how to save the y_training.npy files.
Traceback (most recent call last):
File "
File "/home/ujjwal/anaconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile execfile(filename, namespace)
File "/home/ujjwal/anaconda2/lib/python2.7/site-packages/spyder/utils/site/sitecustomize.py", line 94, in execfile builtins.execfile(filename, *where)
File "/home/ujjwal/Brain-tumor-segmentation-master/train.py", line 119, in
File "/home/ujjwal/anaconda2/lib/python2.7/site-packages/numpy/lib/npyio.py", line 370, in load fid = open(file, "rb")
IOError: [Errno 2] No such file or directory: '/home/ujjwal/Brain-tumor-segmentation-master/y_training.npy'
the *.npy
files are the data that the model is trained on, run extract_patches.py
to get those files and prepare training/validation datasets, please take yourtime to understand the code before opening an issue.
Thank you.
ok. Thank you
Hi,
I am getting ValueError: cannot create group in read only mode in train.py
I evaluated that "ValueError: cannot create group in read only mode " is in io_utils.py in following code: def getitem(self, attr): if isinstance(self.data, dict): if isinstance(attr, bytes): attr = attr.decode('utf-8') if attr in self.data: val = self.data[attr] if isinstance(val, dict) and val.get('_isgroup'): val = H5Dict(val) elif '{}_pickled'.format(attr) in self.data: val = pickle.loads(val) return val else: if self.read_only: raise ValueError('Cannot create group in read only mode.') val = {'_is_group': True} self.data[attr] = val return H5Dict(val) ........................ Please suggest solution
the file
ResUnet.04_0.646.hdf5
is the pretrained weights that the model tries to load to resume a previous training, if you want to train it from scratch replace line 104 intrain.py
withmodel_to_load=None
.
@Issam28 After doing this I got this error at train.py
TypeError: Only integers, slices (:
), ellipsis (...
), tf.newaxis (None
) and scalar tf.int32/tf.int64 tensors are valid indices, got [1, 3]
Please help me to resolve this error
@Issam28 I am getting the IOError like below. What this ResUnet.04_0.646.hdf5 contains ? Please can you help me.
Traceback (most recent call last): File "train.py", line 109, in
brain_seg = Training(batch_size=4,nb_epoch=3,load_model_resume_training=model_to_load)
File "train.py", line 39, in init
self.model =load_model(load_model_resume_training,custom_objects={'gen_dice_loss': gen_dice_loss,'dice_whole_metric':dice_whole_metric,'dice_core_metric':dice_core_metric,'dice_en_metric':dice_en_metric})
File "/home/ujjwal/anaconda2/lib/python2.7/site-packages/keras/models.py", line 234, in load_model
with h5py.File(filepath, mode='r') as f:
File "/home/ujjwal/anaconda2/lib/python2.7/site-packages/h5py/_hl/files.py", line 269, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/home/ujjwal/anaconda2/lib/python2.7/site-packages/h5py/_hl/files.py", line 99, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
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/h5f.pyx", line 78, in h5py.h5f.open
IOError: Unable to open file (unable to open file: name = 'Models/ResUnet.04_0.646.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)