overflocat / fast-neural-style-keras

A Keras Implementation of Fast-Neural-Style
MIT License
23 stars 7 forks source link

Sorry I cannot get it trainning #2

Open zackkit opened 4 years ago

zackkit commented 4 years ago

I created a new config file with the coco2014 data set saved at"train_image_path": "./train2014". Then I got this error: Found 0 images belonging to 0 classes. Traceback (most recent call last): File "main.py", line 31, in train(options) File "I:\anaconda_env\fast-neural-style-keras-master\helper_functions.py", line 124, in train epochs=1, verbose=0, batch_size=options["batch_size"]) File "C:\Users\cheng\anaconda3\envs\anaconda_env\lib\site-packages\keras\engine\training.py", line 1154, in fit batch_size=batch_size) File "C:\Users\cheng\anaconda3\envs\anaconda_env\lib\site-packages\keras\engine\training.py", line 637, in _standardize_user_data training_utils.check_array_length_consistency(x, y, sample_weights) File "C:\Users\cheng\anaconda3\envs\anaconda_env\lib\site-packages\keras\engine\training_utils.py", line 235, in check_array_length_consistency str([x.shape for x in inputs])) ValueError: All input arrays (x) should have the same number of samples. Got array shapes: [(0, 256, 256, 3), (0, 128, 128, 128), (4, 256, 256, 64), (4, 128, 128, 128), (4, 64, 64, 256), (4, 32, 32, 512)]

I am new the style transfer. Have you ever come across the same problem?

zackkit commented 4 years ago

After putting the whole data folder into a another folder, the problem is solved. However, there was a new error: tensorflow.python.framework.errors_impl.FailedPreconditionError: 2 root error(s) found. (0) Failed precondition: Error while reading resource variable _AnonymousVar249 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar249/class tensorf low::Var does not exist. [[node style4/ReadVariableOp (defined at C:\Users\cheng\anaconda3\envs\anaconda_env\lib\site-packages\keras\backend\tensorflow_backend.py:3009) ]] (1) Failed precondition: Error while reading resource variable _AnonymousVar249 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/_AnonymousVar249/class tensorf low::Var does not exist. [[node style4/ReadVariableOp (defined at C:\Users\cheng\anaconda3\envs\anaconda_env\lib\site-packages\keras\backend\tensorflow_backend.py:3009) ]] [[input_8/_7]]

overflocat commented 4 years ago

This seems like an environment error. As I could not access your environment I may not be able to help you solve this problem. On my side it works well.

zackkit commented 4 years ago

I am using anaconda virtual environment. tensorflow-gpu 2.1.0 keras 2.3.1 May I know which version of tensorflow and keras you are using?