Skip to content

Error when running main.py #3

@ghost

Description

Hi, I am using pytorch 0.2 and when I run the script, it generated following errors:

Traceback (most recent call last):
  File "main.py", line 142, in <module>
    main()
  File "main.py", line 116, in main
    meta_model = meta_optimizer.meta_update(model, loss.data)
  File "/home/rvl224/pytorch-meta-optimizer/meta_optimizer.py", line 135, in meta_update
    inputs = Variable(torch.cat((preprocess_gradients(flat_grads), flat_params.data, loss), 1))
  File "/home/rvl224/pytorch-meta-optimizer/utils.py", line 11, in preprocess_gradients
    return torch.cat((x1, x2), 1)
RuntimeError: dim out of range - got 1 but the tensor is only 1D

Is it because I am using a different version of pytorch?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions