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

There is a problem with the sample.py #4

Closed
TO1bHI8Q opened this issue May 11, 2023 · 6 comments
Closed

There is a problem with the sample.py #4

TO1bHI8Q opened this issue May 11, 2023 · 6 comments
Assignees

Comments

@TO1bHI8Q
Copy link

TypeError: ddim_sample_loop() missing 3 required positional arguments: 'data', 'raster', and 'loss'

@wangqiang9 wangqiang9 self-assigned this May 11, 2023
@wangqiang9
Copy link
Owner

TypeError: ddim_sample_loop() missing 3 required positional arguments: 'data', 'raster', and 'loss'

Hi, can you post your full error message?

@TO1bHI8Q
Copy link
Author

TypeError: ddim_sample_loop() missing 3 required positional arguments: 'data', 'raster', and 'loss'

Hi, can you post your full error message?

When I use sample.py, the weight is also model050000.pt
And “all_images” defined as all in line 55 of sample. py, What is the meaning of ”len (all_images)“?

Traceback (most recent call last):
File "D:/SketchKnitter-main/sample.py", line 95, in
main()
File "D:/SketchKnitter-main/sample.py", line 66, in main
sample, pen_state = sample_fn(
TypeError: ddim_sample_loop() missing 3 required positional arguments: 'data', 'raster', and 'loss'

@wangqiang9
Copy link
Owner

data', 'raster', and 'loss'

bug is fix in this pull request: 8250c35

@wangqiang9
Copy link
Owner

wangqiang9 commented May 11, 2023

For example, you can specify data, raster, loss as following:

    loss = th.nn.MSELoss()
    data = load_data(
        data_dir=args.data_dir,
        batch_size=args.batch_size,
        image_size=args.image_size,
        # category=["moon.npz", "airplane.npz", "fish.npz", "umbrella.npz", "train.npz",
        #           "spider.npz", "shoe.npz", "apple.npz", "lion.npz", "bus.npz"],
        category=["apple.npz"],
        class_cond=True,
    )
    raster = AttentionMap().cuda()

@TO1bHI8Q
Copy link
Author

data', 'raster', and 'loss'

bug is fix in this pull request: 8250c35

You also need to modify the code in line 67 ”sample, pen_ state",replace with "sample, pen_ state,_". Then, it work.
Thanks!

@wangqiang9
Copy link
Owner

data', 'raster', and 'loss'

bug is fix in this pull request: 8250c35

You also need to modify the code in line 67 ”sample, pen_ state",replace with "sample, pen_ state,_". Then, it work. Thanks!

Thank you very much for your feedback on the bug, it has been fixed.

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