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

pytorch_experiment.py example not working #28

Open
weicheng113 opened this issue Apr 17, 2022 · 0 comments
Open

pytorch_experiment.py example not working #28

weicheng113 opened this issue Apr 17, 2022 · 0 comments

Comments

@weicheng113
Copy link

weicheng113 commented Apr 17, 2022

following up #14

There maybe some more update again. But it would be good to have pytorch_experiment.py updated also.

use loggers={"visdom": "visdom"} instead of loggers={"vlog": "visdom"}, which is because of pytorchexperiment.vlog(self) implementation.

 exp = MNIST_experiment(config=c, name='experiment', n_epochs=c.n_epochs,
                           seed=42, base_dir='./experiment_dir',
                           loggers={"visdom": "visdom"})

pytorch torchvision.utils.save_image method signature below, but pytorchplotfilelogger.save_image_grid_static

# pytorchplotfilelogger.save_image_grid_static
pytorchplotfilelogger.save_image_grid_static(...):
  tv_save_image(tensor=tensor, filename=img_file, **image_args) # this does not match save_image signature below.

# torchvision.utils.save_image method signature below
def save_image(
    tensor: Union[torch.Tensor, List[torch.Tensor]],
    fp: Union[Text, pathlib.Path, BinaryIO],
    format: Optional[str] = None,
    **kwargs
) -> None:

result in the error below:

Unhandled exception in thread started by <function PytorchPlotFileLogger.save_image_grid_static at 0x000002456711CAF8>
Traceback (most recent call last):
  File "C:\Users\...\lib\site-packages\trixi\logger\file\pytorchplotfilelogger.py", line 183, in save_image_grid_static
    tv_save_image(tensor=tensor, filename=img_file, **image_args)
  File "C:\Users\...t\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
    return func(*args, **kwargs)
TypeError: save_image() missing 1 required positional argument: 'fp'
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