cameronfabbri / Colorful-Image-Colorization

A deep learning approach to colorizing images

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project Not Running as Expected

singhangadin opened this issue · comments

Hi, That's a very interesting project you have developed. However, I have been facing many issues running it. It seems like readme.md has been update recently, however it seems outdated. It says regarding model, train and image directories but I couldn't find them in the project. #1 was really helpful in preparing Images. I would strongly suggest you to mention those steps in Readme.

I extracted 10,000 frames from the video link you shared in #1 issue. This is exactly how processed images look like after using scripts in utils:
Images Directory

Next I used train.py script and used above shown images to train model. This is how it ran:
train.py

After going through the script, I came to the conclusion that Model saved is the result I expect to see if everything goes well. Which I couldn't find in my execution and training time seems to be unbelievable.

train.py creates a pickle file that looks like this:
Pickle File

and a checkpoint directory as below:
screenshot from 2017-03-29 21-45-26

checkpoint/images directory seems to be empty and rest of the files doesn't seem good (Maybe because of their low size).
I might be doing something wrong with the procedure, It would be really helpful if you could guide me through this project.

Now getting this error.

EPOCHS: 10
DATA_DIR: ./Images
BATCH_SIZE: 10

W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "train.py", line 111, in
sess.run(train_op)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 767, in run
run_metadata_ptr)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 965, in _run
feed_dict_string, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1015, in _do_run
target_list, options, run_metadata)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py", line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.OutOfRangeError: FIFOQueue '_1_batch/fifo_queue' is closed and has insufficient elements (requested 10, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_STRING, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/fifo_queue, batch/n)]]

Caused by op u'batch', defined at:
File "train.py", line 57, in
Data = data_ops.loadData(DATA_DIR, BATCH_SIZE)
File "/home/localhost/Downloads/Colorize/New/Colorful-Image-Colorization/data_ops.py", line 253, in loadData
paths_batch, inputs_batch, targets_batch = tf.train.batch([paths, input_images, target_images], batch_size=batch_size)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/input.py", line 872, in batch
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/input.py", line 667, in _batch
dequeued = queue.dequeue_many(batch_size, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/data_flow_ops.py", line 458, in dequeue_many
self._queue_ref, n=n, component_types=self._dtypes, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_data_flow_ops.py", line 1310, in _queue_dequeue_many_v2
timeout_ms=timeout_ms, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op
op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2327, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1226, in init
self._traceback = _extract_stack()

OutOfRangeError (see above for traceback): FIFOQueue '_1_batch/fifo_queue' is closed and has insufficient elements (requested 10, current size 0)
[[Node: batch = QueueDequeueManyV2[component_types=[DT_STRING, DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/job:localhost/replica:0/task:0/cpu:0"](batch/fifo_queue, batch/n)]]

Still getting same error, Have also tried with full directory path. I am getting correct file names in pickle file. I am trying to train upon 500 images, I don't feel like that could be a cause for this.

Hey, I am uploading a video this time, hopefully that might help you in findings.
Screencast_Friday 31 March 2017_01:23:42 IST.webm.zip

I forgot to show pickle file in the end, here is its picture:
screenshot from 2017-03-31 01-34-41

One more thing I want to mention, In error text I wrote earlier:

OutOfRangeError (see above for traceback): FIFOQueue '_1_batch/fifo_queue' is closed and has insufficient elements (requested 10, current size 0)

Current size was 0, however the error I got in the video has 3.

I tried changing batch size to 3 however still got same error.

Finally script is running. I tried to run script after removing '-' in directory but it didn't made any difference. Removing resized and grayscale images worked for me. I am saving model after every 5th iteration:
Here is a snapshot for that:
screenshot from 2017-03-31 10-54-13

Will continue further after few iterations.

Apparently, I am not having a gpu. So, I will try it out in very less images. It would be a huge help if you could provide with a trained model. Thank you for helping.

I trained model with 10 images to make things faster, Now I am getting similar error with eval.py, I changed batch size to 1. Earlier, Deleting gray scale and resized images from training image set worked for me. I still can't figure out why are we getting this error as I cant see any hard coded expression for images.

Below is the snapshot of error:
screenshot from 2017-04-01 12-35-53
screenshot from 2017-04-01 12-35-27

Below are test images I am trying to colorize:
screenshot from 2017-04-01 12-30-11

I think grayscale images are cause of this error. As an experiment I trained model on frames/resized images and used same images for testing/colorizing and there was no problem with running scripts. However, if grayscale images were a part of either train/test images I am getting errors mentioned above.