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: Saver.write_model() missing 1 required positional argument: 'model' #8

Open
SahPet opened this issue Sep 22, 2022 · 0 comments

Comments

@SahPet
Copy link

SahPet commented Sep 22, 2022

Hi!

New to pytorch training so bare with me:)
I managed to start a training, but I get an error message at the end of training (I set max_it to only 500 as an initial test). I've downloaded the gan_weights.pth model and put it in a folder called \model in the project folder (dataroot) and changed line 29 in model.py to

resume = '/model/gan_weights.pth'

After training I get this error message:

total_it: 492 (ep 6, it 56), lr 0.000100
total_it: 493 (ep 6, it 59), lr 0.000100
total_it: 494 (ep 6, it 62), lr 0.000100
total_it: 495 (ep 6, it 65), lr 0.000100
total_it: 496 (ep 6, it 68), lr 0.000100
total_it: 497 (ep 6, it 71), lr 0.000100
total_it: 498 (ep 6, it 74), lr 0.000100
total_it: 499 (ep 6, it 77), lr 0.000100
Traceback (most recent call last):
  File "C:\Users\IT-bruker\HistAuGAN-main\histaugan\train.py", line 112, in <module>
    main()
  File "C:\Users\IT-bruker\HistAuGAN-main\histaugan\train.py", line 94, in main
    saver.write_model(-1, model)
TypeError: Saver.write_model() missing 1 required positional argument: 'model'

Any idea how to solve this?

For one of the first trainings (not quite sure what was different then), the \results folder contained two images that looked like this (see below), so the training produced something at some point, and that training seems to be working in terms of stain style transfer:
gen_-0001
gen_00004

Some additional questions:
Can I add some code to train.py to make it display the loss for each epoch?

How do I run inference on another set of images when a trained model is done, and how do I chose which style to be applied during inference (trainA or trainB)?

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

1 participant