Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repo please?? #9

Open
quintendewilde opened this issue Jan 2, 2021 · 2 comments
Open

Update repo please?? #9

quintendewilde opened this issue Jan 2, 2021 · 2 comments

Comments

@quintendewilde
Copy link

I'm trying to make this to work on current platform and versions but it's very hard for a newbie like me..

Any help with this?

disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
Traceback (most recent call last):
File "style.py", line 6, in
from optimize import optimize
File "src/optimize.py", line 6, in
from utils import get_img
File "src/utils.py", line 23
return img
^

IndentationError: expected an indented block
(mlquinten) ubuntu@ip-172-31-51-152:~/training_styletransfer$ sudo nano src/utils.py
(mlquinten) ubuntu@ip-172-31-51-152:~/training_styletransfer$ bash run.sh
WARNING:tensorflow:From /home/ubuntu/mlquinten/lib/python3.7/site-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
Traceback (most recent call last):
  File "style.py", line 6, in <module>
    from optimize import optimize
  File "src/optimize.py", line 6, in <module>
    from utils import get_img
  File "src/utils.py", line 22
    return img
         ^
IndentationError: expected an indented block
(mlquinten) ubuntu@ip-172-31-51-152:~/training_styletransfer$ sudo nano src/utils.py
(mlquinten) ubuntu@ip-172-31-51-152:~/training_styletransfer$ bash run.sh
WARNING:tensorflow:From /home/ubuntu/mlquinten/lib/python3.7/site-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
ml5.js Style Transfer Training!
Note: This traning will take a couple of hours.
Training is starting!...
Train set has been trimmed slightly..
(1, 512, 362, 3)
UID: 25
Traceback (most recent call last):
  File "style.py", line 179, in <module>
    main()
  File "style.py", line 156, in main
    for preds, losses, i, epoch in optimize(*args, **kwargs):
  File "src/optimize.py", line 107, in optimize
    X_batch[j] = get_img(img_p, (256,256,3)).astype(np.float32)
ValueError: could not broadcast input array from shape (427,640,3) into shape (256,256,3)
@shiffman
Copy link
Member

shiffman commented Jan 4, 2021

Hi @quintendewilde, sorry that this repo hasn't had a lot of attention as of late! I was recently able to train the model by following @yining1023's google colab notebook:

https://colab.research.google.com/drive/1TZNdhoUEBoxQqY5EFloZcuyYUs9oNQ-g?usp=sharing

More info:
https://github.com/yining1023/machine-learning-for-the-web/tree/master/week5-styleTransfer#coding-session

shiffman added a commit that referenced this issue Jan 4, 2021
This repo needs a larger update but this is a short-term fix for #9. Thanks @yining1023 for the excellent resources!
@epphone
Copy link

epphone commented Sep 22, 2023

Hello! I have recently used the google colab notebook to train a model for style transfer for a new and exciting installation I made. However I had many problems with compatibility, due to colab not being able to install the tensorflow v1.14.
Turns out(!), training with newer versions leads to functional models to use with ml5, even with ml5's older tensorflow implementation.

I have a new colab notebook here, but I had to change a couple of files :

Here is the new notebook :
https://colab.research.google.com/drive/1TFuIUStPP3bZMrjPYyIwcVVLHAVeCEXo?usp=sharing

I've include a zip with the updated files, but maybe forks of the above githubs with updated files would be better?
ml5_styleTransfer_github.zip
Still a noob at Github, sorry!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants