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

Error when running train step #36

Open
ngockimhoang opened this issue Nov 25, 2021 · 3 comments
Open

Error when running train step #36

ngockimhoang opened this issue Nov 25, 2021 · 3 comments

Comments

@ngockimhoang
Copy link

ngockimhoang commented Nov 25, 2021

Hi,
I want to ask if the master branch can run the train step?
python main.py --phase train --dataset Hayao --data_mean [13.1360,-8.6698,-4.4661] --epoch 101 --init_epoch 10
I got a lot of errors running above command.
Example:
Traceback (most recent call last):
File "main.py", line 114, in
main()
File "main.py", line 106, in main
gan.train()
File "/home/kimhoang/emvn/AnimeGANv2/AnimeGANv2.py", line 233, in train
anime, anime_smooth, real = self.sess.run([anime_img_op, anime_smooth_op, real_img_op])
File "/home/kimhoang/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 956, in run
run_metadata_ptr)
File "/home/kimhoang/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run
feed_dict_tensor, options, run_metadata)
File "/home/kimhoang/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run
run_metadata)
File "/home/kimhoang/.pyenv/versions/3.6.0/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node _inference_Dataset_map_16913}} UFuncTypeError: Cannot cast ufunc 'add' output from dtype('<U32') to dtype('float32') with casting rule 'same_kind'

@TachibanaYoshino
Copy link
Owner

TachibanaYoshino commented Nov 26, 2021

You can refer to the issue. TachibanaYoshino/AnimeGAN#48 (comment)

@ngockimhoang
Copy link
Author

@TachibanaYoshino the solution in that comment fixes the issue.
I got below traces in output
[] Reading checkpoints...
[
] Failed to find a checkpoint
[!] Load failed...
And the next step "Extract the weights of the generator" will fail with error [*] Failed to find a checkpoint, because this folder ../checkpoint/AnimeGAN_Hayao_lsgan_300_300_1_2_10_1 is missing
So I suppose this checkpoint folder is generated by the train step.
Am I still missing something in the train step?

@TachibanaYoshino
Copy link
Owner

Yes, when you run train.py to perform training, all the parameters of the network will be saved in the folder AnimeGAN_Hayao_lsgan_300_300_1_2_10_1. After the training is completed, execute get_generator_ckpt.py to obtain the weight of the generator network of your specified epoch. After getting the weight of the generator, you can use test.py to realize the function of converting pictures to animation or use video2anime.py to realize the function of converting videos to animation.
Of course, I have trained the weights of the three animation style generators. You can directly perform the function of converting pictures or videos to animation without training the network yourself.

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

2 participants