memo / webcam-pix2pix-tensorflow

Source code and pretrained model for running pix2pix in realtime on a webcam feed.
https://www.memo.tv/works/learning-to-see/
MIT License
353 stars 68 forks source link

Custom model #3

Open Ocelyn opened 6 years ago

Ocelyn commented 6 years ago

Hello,

First, I'd like to thank you a lot for sharing your code in open source, it's an amazing project !

I have spent 3 days trying to create my own model with no success.

I am on OSX, using Tensorflow 1.2 (try with Tensorflow 1.4 though), your model works well but when I switch to my JSON I had plenty of errors I have been able to solve. But this one, let me clueless. I train my model with https://github.com/affinelayer/pix2pix-tensorflow as you describe it, in your readme.

Capturer.init with 0 (480, 640) 30 [256, 256, 3] Initialized at 640x480 at 30.00003fps Capturer.run Traceback (most recent call last): File "webcam-pix2pix.py", line 112, in <module> img_predicted = predictor.predict(img_in)[0] File "/Users/jocelynlecamus/tensorflow/webcam/msa/predictor.py", line 76, in predict model_out = self.sess.run( [self.output_op], { self.input_op: img })[0] File "/Users/jocelynlecamus/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 789, in run run_metadata_ptr) File "/Users/jocelynlecamus/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 975, in _run % (np_val.shape, subfeed_t.name, str(subfeed_t.get_shape()))) ValueError: Cannot feed value of shape (1, 256, 256, 3) for Tensor u'load_images/input_producer/Const:0', which has shape '(40,)'

40 is the number of images I trained (I know it's a small number but I am trying to make the things work before taking my time to generate a real complete model)

Do you have any idea or where the problem might come? Thank you so much for your help, and sorry for my awful english skill.

Best

skabbit commented 4 years ago

I suppose you used pix2pix version released later than webcam-pix2pix-tensorflow. I've found out the changes in mode=export made in pix2pix, that is not compatible with this repo. I made a fix for this project and I may pull a request if you're still interested in this project.