Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occured on Step 4 Execute script #1

Closed
w617156977 opened this issue Sep 29, 2018 · 10 comments
Closed

An error occured on Step 4 Execute script #1

w617156977 opened this issue Sep 29, 2018 · 10 comments

Comments

@w617156977
Copy link

when I execute ./pipeline,an error occurs like this:
default
default
thanks for help!

@snapfinger
Copy link
Owner

Hi, it looks like two separate errors, and the error in your second snapshot is likely to be caused by the first one.
Your second error indicates you are trying to test a model which has not yet been produced. Have you checked you have run through training procedure completely? If so, what are the files in your /data/models directory?
Also, is your machine equipped with Nvidia GPU and installed with package tensorflow-gpu (1.3.0) as stated in readme? You need these to run the code.

@w617156977
Copy link
Author

Do I have to use all the samples for training?I didn't download all the samples because the download speed was too slow.I only used the first 16 of 82 samples.

@w617156977
Copy link
Author

The errors occurred before the first epoch of training was completed, so no files were generated in /data/models.

@snapfinger
Copy link
Owner

Data size should not matter b/c batch size is 1. Are you using same versions of dependencies specified in readme? If everything is the same the first error should not occur.

@w617156977
Copy link
Author

All Main Dependencies are same as that in readme ,It still doesn't work.

@w617156977
Copy link
Author

default
Error occurs in Fitting model

@snapfinger
Copy link
Owner

From search results on the internet: keras-team/keras#3657, MattVitelli/GRUV#18 (comment), you may need to check if you constructed the input training numpy array correctly (i.e. not empty). Also, please paste full log output in text (not snapshot) so I can better aid you.

@w617156977
Copy link
Author

supreme@Supreme:~/Documents/repo$ ./pipeline
data_path: /home/supreme/Documents/data
Initialization starts.
Writing training image list.
Writing testing image list.
Initialization is done.
data_path: /home/supreme/Documents/data

Creating training data...

Training data created for fold 0, plane Z
/home/supreme/anaconda2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
data_path: /home/supreme/Documents/data
number of epoch: 10
learning rate: 1e-05

     Loading and preprocessing train data...


	Creating and compiling model...

start building NN


Layer (type) Output Shape Param # Connected to

input_1 (InputLayer) (None, 192, 256, 1) 0


conv2d_1 (Conv2D) (None, 192, 256, 64) 640 input_1[0][0]


conv2d_2 (Conv2D) (None, 192, 256, 64) 36928 conv2d_1[0][0]


max_pooling2d_1 (MaxPooling2D) (None, 96, 128, 64) 0 conv2d_2[0][0]


conv2d_3 (Conv2D) (None, 96, 128, 128) 73856 max_pooling2d_1[0][0]


conv2d_4 (Conv2D) (None, 96, 128, 128) 147584 conv2d_3[0][0]


max_pooling2d_2 (MaxPooling2D) (None, 48, 64, 128) 0 conv2d_4[0][0]


conv2d_5 (Conv2D) (None, 48, 64, 256) 295168 max_pooling2d_2[0][0]


conv2d_6 (Conv2D) (None, 48, 64, 256) 590080 conv2d_5[0][0]


max_pooling2d_3 (MaxPooling2D) (None, 24, 32, 256) 0 conv2d_6[0][0]


conv2d_7 (Conv2D) (None, 24, 32, 512) 1180160 max_pooling2d_3[0][0]


conv2d_8 (Conv2D) (None, 24, 32, 512) 2359808 conv2d_7[0][0]


max_pooling2d_4 (MaxPooling2D) (None, 12, 16, 512) 0 conv2d_8[0][0]


conv2d_9 (Conv2D) (None, 12, 16, 1024) 4719616 max_pooling2d_4[0][0]


conv2d_10 (Conv2D) (None, 12, 16, 512) 4719104 conv2d_9[0][0]


conv2d_transpose_1 (Conv2DTrans (None, 24, 32, 512) 1049088 conv2d_10[0][0]


concatenate_1 (Concatenate) (None, 24, 32, 1024) 0 conv2d_transpose_1[0][0]
conv2d_8[0][0]


conv2d_11 (Conv2D) (None, 24, 32, 512) 4719104 concatenate_1[0][0]


conv2d_12 (Conv2D) (None, 24, 32, 256) 1179904 conv2d_11[0][0]


conv2d_transpose_2 (Conv2DTrans (None, 48, 64, 256) 262400 conv2d_12[0][0]


concatenate_2 (Concatenate) (None, 48, 64, 512) 0 conv2d_transpose_2[0][0]
conv2d_6[0][0]


conv2d_13 (Conv2D) (None, 48, 64, 256) 1179904 concatenate_2[0][0]


conv2d_14 (Conv2D) (None, 48, 64, 128) 295040 conv2d_13[0][0]


conv2d_transpose_3 (Conv2DTrans (None, 96, 128, 128) 65664 conv2d_14[0][0]


concatenate_3 (Concatenate) (None, 96, 128, 256) 0 conv2d_transpose_3[0][0]
conv2d_4[0][0]


conv2d_15 (Conv2D) (None, 96, 128, 128) 295040 concatenate_3[0][0]


conv2d_16 (Conv2D) (None, 96, 128, 64) 73792 conv2d_15[0][0]


conv2d_transpose_4 (Conv2DTrans (None, 192, 256, 64) 16448 conv2d_16[0][0]


concatenate_4 (Concatenate) (None, 192, 256, 128 0 conv2d_transpose_4[0][0]
conv2d_2[0][0]


conv2d_17 (Conv2D) (None, 192, 256, 64) 73792 concatenate_4[0][0]


conv2d_18 (Conv2D) (None, 192, 256, 64) 36928 conv2d_17[0][0]


conv2d_19 (Conv2D) (None, 192, 256, 1) 65 conv2d_18[0][0]

Total params: 23,370,113
Trainable params: 23,370,113
Non-trainable params: 0


None

	Fitting model...

Epoch 1/10
Traceback (most recent call last):
File "unet.py", line 171, in
train(cur_fold, plane, batch_size, epoch, init_lr)
File "unet.py", line 166, in train
callbacks=[model_checkpoint, csv_logger])
File "/home/supreme/anaconda2/lib/python2.7/site-packages/keras/engine/training.py", line 1037, in fit
validation_steps=validation_steps)
File "/home/supreme/anaconda2/lib/python2.7/site-packages/keras/engine/training_arrays.py", line 217, in fit_loop
callbacks.on_epoch_end(epoch, epoch_logs)
File "/home/supreme/anaconda2/lib/python2.7/site-packages/keras/callbacks.py", line 77, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/home/supreme/anaconda2/lib/python2.7/site-packages/keras/callbacks.py", line 336, in on_epoch_end
self.progbar.update(self.seen, self.log_values)
AttributeError: 'ProgbarLogger' object has no attribute 'log_values'
/home/supreme/anaconda2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Using TensorFlow backend.
data_path: /home/supreme/Documents/data

loading model unet_fd0_Z_ep10_lr1e-5

Traceback (most recent call last):
File "testvis.py", line 181, in
test(model_to_test, cur_fold, plane, rst_path, vis)
File "testvis.py", line 65, in test
model = load_model(model_path + model_to_test + '.h5', custom_objects={'dice_coef_loss': dice_coef_loss, 'dice_coef':dice_coef})
File "/home/supreme/anaconda2/lib/python2.7/site-packages/keras/engine/saving.py", line 249, in load_model
f = h5py.File(filepath, mode='r')
File "/home/supreme/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/supreme/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 = '/home/supreme/Documents/data/models/unet_fd0_Z_ep10_lr1e-5.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

@snapfinger
Copy link
Owner

Seems you didn't even sliced the data successfully (the first step in script). I just tried with two cases without problem, so data number does not matter. Check whether you put your file in correct places.

@w617156977
Copy link
Author

Could you show me where your files are ,please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants