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

TypeError: SANTAModel.translate() takes 2 positional arguments but 3 were given #4

Open
LT1st opened this issue Apr 26, 2024 · 4 comments

Comments

@LT1st
Copy link

LT1st commented Apr 26, 2024

How to handle this problem?

(epoch: 5, iters: 5000, time: 0.348, data: 0.002) G_GAN: 0.222 D_real: 0.411 D_fake: 0.198 G_rec: 0.092 G_idt: 0.042 G_kl: 1.145 G_path: 0.391 d1: 0.402 d2: 0.252 energy_0: 0.002 energy_3: 0.007 energy_6: 0.111 energy_10: 0.198 energy_14: 1.638 
saving the latest model (epoch 5, total_iters 25000)
santa/FLIR_AtoB/lam0.1_layers0,3,6,10,14_dim8_rec5_idt5.0_pool0_noise1.0_kl0.01
saving the model at the end of epoch 5, iters 25000
Traceback (most recent call last):
  File "/home/customer/Desktop/LT/gan/santa-main/train.py", line 86, in <module>
    results = eval_loader(model, test_loader_a, test_loader_b, opt.run_dir, opt)
  File "/root/usr/anaconda3/envs/mamba/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/customer/Desktop/LT/gan/santa-main/models/utils.py", line 88, in eval_loader
    fake = model.translate(data['A'].cuda(), acc_data['A'].cuda())
  File "/root/usr/anaconda3/envs/mamba/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
TypeError: SANTAModel.translate() takes 2 positional arguments but 3 were given
@tusharrewatkar
Copy link

tusharrewatkar commented May 29, 2024

Change --eval_epoch_freq to any larger number of epoch (for e.g 100, it will run and throw error at 100th epoch).
Its not a solution of the given problem, but a work around. You can train your model to as many number of epochs and then evaluate using test.py.

@tanfy929
Copy link

Have you successfully solved this problem? I got the same error

@tusharrewatkar
Copy link

Yes, its a work around which I mentioned above.

@tanfy929
Copy link

Perhaps this error does not affect the training and saving of the model? I think this is just for the purpose of calculating the metric in some iteration steps, so that we can select the final model to be tested according to the verification results. I haven't looked at the code details enough to know if I understand this correctly

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