racinmat / anime-style-transfer Goto Github PK
View Code? Open in Web Editor NEWStyle transfer for between real photos and anime images using CycleGAN
Style transfer for between real photos and anime images using CycleGAN
The .pb file format model included in this repository is very old.
So I converted it to PyTorch and tensorflow2 styles.
https://github.com/tanreinama/anime-style-transfer-tf2_pytorch
I think you could write a requirements, because I have some problem when I do test
I have some problems like this
Traceback (most recent call last):
File "/home/evga/anaconda3/envs/mlj7/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 427, in import_graph_def
graph._c_graph, serialized, options) # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 4 but is rank 5 for 'import/real-anime-gen/c-7-1-64-r/Conv2D' (op: 'Conv2D') with input shapes: [1,?,512,512,?], [7,7,3,64].
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "transform.py", line 175, in <module>
tf.app.run()
File "/home/evga/anaconda3/envs/mlj7/lib/python3.7/site-packages/tensorflow/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home/evga/anaconda3/envs/mlj7/lib/python3.7/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/home/evga/anaconda3/envs/mlj7/lib/python3.7/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "transform.py", line 153, in main
transform_files(im_paths)
File "transform.py", line 137, in transform_files
feeder, ceil(len(im_paths) / FLAGS.batchsize), FLAGS.batchsize, persist_images_postprocessing)
File "/home/evga/work/mlj/mlj-demo/face_dongman/anime-style-transfer/code/mod-cycle-gan/cycle/_model.py", line 398, in test_one_part
d_input, d_output, output = CycleGAN.get_graph_outputs(graph, dataset[0], pb_model)
File "/home/evga/work/mlj/mlj-demo/face_dongman/anime-style-transfer/code/mod-cycle-gan/cycle/_model.py", line 430, in get_graph_outputs
input_map={'input': input_var},return_elements=CycleGAN.OUTPUT_NODES)))
File "/home/evga/anaconda3/envs/mlj7/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/home/evga/anaconda3/envs/mlj7/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 431, in import_graph_def
raise ValueError(str(e))
ValueError: Shape must be rank 4 but is rank 5 for 'import/real-anime-gen/c-7-1-64-r/Conv2D' (op: 'Conv2D') with input shapes: [1,?,512,512,?], [7,7,3,64].
can anyone give me some answer.
I trained my network with my own data set and got the .pb file, but I can't run transform.py
This is the error I get. I get stuck in orig_names.map(load_image, num_parallel_calls=10)
There were some errors in the train code too like locations of files so I think this one is relative to it. Can you please check this? I put the .pb file in export/(Date)/ like you did. (But it was made inside my checkpoint folder. I think this is another error in train.py) + I can not transform using your pb file.
WARNING: Logging before flag parsing goes to stderr.
W0907 01:16:41.153303 140425955747584 deprecation_wrapper.py:119] From /media/kaist/새 볼륨1/CycleGan-anime-tensorflow/code/mod-cycle-gan/cycle/_model.py:446: The name tf.train.Optimizer is deprecated. Please use tf.compat.v1.train.Optimizer instead.
W0907 01:16:41.156838 140425955747584 deprecation_wrapper.py:119] From transform.py:174: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
using images in path: ./test_data/Coco-stuff/*.jpg
will transform 8 images:
rundir: 2019-09-04--17-15-0 cpdir: ../../checkpoint
model loaded, starting with inference
W0907 01:16:41.162252 140425955747584 deprecation_wrapper.py:119] From transform.py:93: The name tf.read_file is deprecated. Please use tf.io.read_file instead.
W0907 01:16:41.169234 140425955747584 deprecation.py:323] From transform.py:111: ignore_errors (from tensorflow.contrib.data.python.ops.error_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.data.experimental.ignore_errors()
.
W0907 01:16:41.175783 140425955747584 deprecation_wrapper.py:119] From /media/kaist/새 볼륨1/CycleGan-anime-tensorflow/code/mod-cycle-gan/images_to_tfrecord.py:32: The name tf.image.resize_image_with_pad is deprecated. Please use tf.compat.v1.image.resize_image_with_pad instead.
Repl Closed
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.