-
Notifications
You must be signed in to change notification settings - Fork 7
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 example code #2
Comments
While I am unsure of the exact cause of your error, I will recommend that you ensure that your model's training images are properly loaded. I just cloned this repository and began training it on my custom dataset using all default settings except the --impl=cuda option, and everything appears to be working fine. |
So the error you mentioned is coming due to the loss ns_pathreg_r1() used for afhq and ffhq. Change the loss to ns_DiffAugment_r1() which doesn't need labels and it will work fine. Due to some unknown reason the number of labels are none when the model starts training while using the ns_pathreg_r1() loss. |
I have tried many things to use GradientTape.gradient() but could not do it, I switch it to tf.gradients to use StyleGan2 ppl loss, it worked;
|
I have been trying to get this repo to work but I am running into an issue. After cloning this repo and downloading the afhq dataset, I attemp to run the code using this command:
python main.py train --dataset_name afhq --dataset_path C:\Users\user\Documents\ATR\data\afhq --batch_size 4 --res 512 --config e --impl ref
Once training starts, however, I get an error returned:
`
Traceback (most recent call last):
File "main.py", line 99, in
main()
File "main.py", line 66, in main
trainer.train()
File "C:\Users\user\Documents\GitHub\StyleGAN2\train.py", line 150, in train
G_loss, D_loss = self.train_step(real_images, real_labels)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\def_function.py", line 780, in call
result = self._call(*args, **kwds)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\def_function.py", line 823, in _call
self._initialize(args, kwds, add_initializers_to=initializers)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\def_function.py", line 696, in _initialize
self._stateful_fn._get_concrete_function_internal_garbage_collected( # pylint: disable=protected-access
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\function.py", line 2855, in _get_concrete_function_internal_garbage_collected
graph_function, _, _ = self._maybe_define_function(args, kwargs)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\function.py", line 3213, in _maybe_define_function
graph_function = self._create_graph_function(args, kwargs)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\function.py", line 3065, in _create_graph_function
func_graph_module.func_graph_from_py_func(
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\framework\func_graph.py", line 986, in func_graph_from_py_func
func_outputs = python_func(*func_args, **func_kwargs)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\def_function.py", line 600, in wrapped_fn
return weak_wrapped_fn().wrapped(*args, **kwds)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\eager\function.py", line 3735, in bound_method_wrapper
return wrapped_fn(*args, **kwargs)
File "C:\Users\user\AppData\Local\Continuum\anaconda3\envs\capsule\lib\site-packages\tensorflow\python\framework\func_graph.py", line 973, in wrapper
raise e.ag_error_metadata.to_exception(e)
ValueError: in user code:
`
The text was updated successfully, but these errors were encountered: