neural-style-tf icon indicating copy to clipboard operation
neural-style-tf copied to clipboard

Google Colab Full Functional Application

Open ljm2020 opened this issue 6 years ago • 9 comments

Hello I ported your model into Google Colab and created a fully functional application, including image and video transfer.

Colab: Chinese and English Dual Language Version updated: https://colab.research.google.com/drive/18w-b-ntmA8Y5u7JYLrwPqFAIefj4ZFH5

iPynb: https://github.com/ljm2020/Neural-Style-TF-Application

Really appreciate your work.

ljm2020 avatar Jul 23 '18 07:07 ljm2020

This is awesome!

lcb931023 avatar Sep 04 '18 17:09 lcb931023

Hey ljm,

I encountered an error when using the notebook. Would you mind taking a look?

This occurred when running Output_Img=Image_Convert(main_dir).

FileNotFoundError: [Errno 2] No such file or directory: '/content/neural-style-tf/image_output/{Single_File}-stylized/{Single_File}-stylized.png'

lcb931023 avatar Sep 04 '18 17:09 lcb931023

Hey ljm,

I encountered an error when using the notebook. Would you mind taking a look?

This occurred when running Output_Img=Image_Convert(main_dir).

FileNotFoundError: [Errno 2] No such file or directory: '/content/neural-style-tf/image_output/{Single_File}-stylized/{Single_File}-stylized.png'

looks like there is a change in the method of connecting Google Drive to Colab. I have fixed in the code, try again:) (be sure to run the step 1 and 2 at begining)

ljm2020 avatar Sep 25 '18 03:09 ljm2020

Thank you! it worked great :)

deivca avatar Nov 19 '18 23:11 deivca

Hi!

I have the same error :( Could it be that they changed something again? Ty

guidoxmartina avatar May 27 '20 13:05 guidoxmartina

Hi ljm!

I encountered the same error, too. Could you kindly take a look?

ShiqingTang avatar Jun 16 '20 11:06 ShiqingTang

the true error is not the "file not found", but "with tf.device(args.device), tf.Session() as sess: AttributeError: module 'tensorflow' has no attribute 'Session'", so the conversion was never took place so no output image ever was generated. Tensorflow is supported by Colab by default, maybe Google updated the version and now it does not compatible to the code in Cysmith's neural-style-tf.py. I'm no expert of tensorflow, this might need help from Cysmith him/her self:(

@cysmith can you help look into it?

ljm2020 avatar Jun 17 '20 03:06 ljm2020

the true error is not the "file not found", but "with tf.device(args.device), tf.Session() as sess: AttributeError: module 'tensorflow' has no attribute 'Session'", so the conversion was never took place so no output image ever was generated. Tensorflow is supported by Colab by default, maybe Google updated the version and now it does not compatible to the code in Cysmith's neural-style-tf.py. I'm no expert of tensorflow, this might need help from Cysmith him/her self:(

@cysmith can you help look into it?

Fixed the issue by manually changing the tensorflow version in Colab back to 1.x (the default version has upgraded to 2.x in Colab) you can try it again: https://colab.research.google.com/drive/18w-b-ntmA8Y5u7JYLrwPqFAIefj4ZFH5

ljm2020 avatar Jun 24 '20 07:06 ljm2020

Also ensure your runtime type is set to GPU in colab.

Runtime > Change Runtime type > GPU

Very helpful resource for exploring this repo, thank you @ljm2020!

merri-ment avatar Jul 06 '20 02:07 merri-ment