-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Convert magenta/image_stylization model on Android, but doesn't work #9678
Comments
I have the same problem. |
Mark~ |
Similar problem. |
When I use image stylization model, I got this log and looks correct:
This is when I use mine. not right...
|
@haikuoyao The stat_summarizer spam might be due to changing the input size while the debug mode is active (making the sizes of all the tensors change). Is this the case? If so you can safely ignore those log messages. Do you see anything else in the log that might indicate an issue? @guanlicome @funzhang @SnailTyan To be clear you're all experiencing the same problem after following the steps @haikuoyao describes above? Just trying to understand how so many people are suddenly seeing the same issue :) |
Thanks. @andrewharp I didn't see anything else in my log and don't find any doc about how to convert I wonder did I use the correct way to this? I saw |
There are some Nans in the ckpt you downloaded from the wed. |
Thanks. @JiaoLiu It works now. |
I also met this question (on ios), but I am not very clear about : "There are some Nans in the ckpt you downloaded from the wed.You should get rid of them. Then you will get right outputs on the mobile device." so , how to do that...? |
@haikuoyao I have followed the scripts in your first post, but when i use the generated quantize_graph.pb to transfer style with magenta/models/image_stylization/image_stylization_transform.py, i got the following error: Caused by op u'save/RestoreV2_2', defined at: DataLossError (see above for traceback): Unable to open table file models/quantize_graph.pb: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator? My environment is ubuntu 16.04/tensorflow 1.4/python 2.7. Actually, i have trained the model myself, i got the following output: And i use above trained model and get the same error message. I can use above model to transfer style with magenta/models/image_stylization/image_stylization_transform.py, but i failed to convert the trained model(checkpoint) to quantized_graph.pb Thanks for any help! |
Any solution on this? Still trying to freeze ckpt |
I try TF Stylize on Android and it works perfectly. Also I find the training code of this image stylization model. Its name is magenta/image_stylization and provides two pre-trained models: Monet and Varied. The first one had 10 styles and second has 32.
So my idea it to use them to replace image stylization model.
Here is what I did.
1 Save
*.ckpt
model to*.pb
Save graph
Freeze Graph
Inference
Quantize
2 Replace model with
quantize_graph.pb
Then I got an issue.
I can see there are 10 styles and they display on the screen :
However, the image is not transformed. There's no style on the image. It's the just original image.
TF version is 1.1.0. Android is 6.0.1
Anyone met the same issue or anyone knew how exactly to convert these two models and use on mobile?
The text was updated successfully, but these errors were encountered: