CompVis / adaptive-style-transfer

source code for the ECCV18 paper A Style-Aware Content Loss for Real-time HD Style Transfer
https://compvis.github.io/adaptive-style-transfer/
GNU General Public License v3.0
723 stars 139 forks source link

Prediction Works, but Training Fails at Startup #6

Closed Jaliborc closed 5 years ago

Jaliborc commented 5 years ago

Hi. I am trying to run your example commands from the README file and the prediction is working perfectly. Yet, when I attempt to run your training example, the script crashes at startup:

Traceback (most recent call last): File "main.py", line 149, in tf.app.run() File "C:\Users\j-cardoso\AppData\Local\Continuum\anaconda2\envs\Python 3.6\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "main.py", line 129, in main model = Artgan(sess, args) File "C:\Users\j-cardoso\Documents\adaptive-style-transfer\model.py", line 68, in init self._build_model() File "C:\Users\j-cardoso\Documents\adaptive-style-transfer\model.py", line 133, in _build_model tf.add_n(self.input_photo_discr_loss.values()) + \ File "C:\Users\j-cardoso\AppData\Local\Continuum\anaconda2\envs\Python 3.6\lib\site-packages\tensorflow\python\ops\math_ops.py", line 2118, in add_n raise ValueError("inputs must be a list of at least one Tensor with the " ValueError: inputs must be a list of at least one Tensor with the same dtype and shape

Any idea why this is happening? I downloaded the van-gogh image set and the places365_standard database.

viniciusarruda commented 5 years ago

You are using python 3.6, but the source was made for python 2. I had this problem too, and I am working to run on python 3 with a newer version of tensorflow.

asanakoy commented 5 years ago

Yes, our source code is for python 2.*.

HenriAW commented 5 years ago

Hi I had the same error and it was because I was using python 3 (same error on Windows and Linux). TensorFlow with Python 2 is not supported on Windows, so I'm running it inside a docker container at the moment which is working!

asanakoy commented 5 years ago

I'm closing this. Please use Python 2.7 and Tensorflow 1.2.

HenriAW commented 5 years ago

I managed to get the training working in python 3 by using this website to convert the file model.py to python 3. Working ok now, although training is taking a while. Out of interest, what hardware was used for training the current models, and how long did it take?