Skip to content

Got 'nan' when using MetaAdam as a inner_opt #26

Closed
@hccz95

Description

@hccz95

I just made two modifications on examples/few-shot/maml-omniglot.py:

  1. change the net structure in line 98 to my net:
net = nn.Sequential(
    nn.Conv2d(1, 64, (3, 3), 2, 0), nn.BatchNorm2d(64), nn.ReLU(),
    nn.Conv2d(64, 64, (3, 3), 2, 0), nn.BatchNorm2d(64), nn.ReLU(),
    nn.Conv2d(64, 64, (3, 3), 2, 0), nn.BatchNorm2d(64), nn.ReLU(),
    nn.Conv2d(64, 64, (2, 2), 1, 0), nn.BatchNorm2d(64), nn.ReLU(),
    nn.Flatten(), nn.Linear(64, args.n_way),
).to(device)
  1. change the inner_opt from MetaSGD to MetaAdam in line 120.

Then I got 'nan' parameters after first time of meta_opt.step()

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions