Skip to content

Conversation

@NikolaAndro
Copy link

I was loading xception-full model and got an error:

taskaugment_venv/lib/python3.10/site-packages/torch/nn/init.py:405: UserWarning: Initializing zero-element tensors is a no-op
  warnings.warn("Initializing zero-element tensors is a no-op")
Traceback (most recent call last):
  File "taskaugment/MTVulnerability/experiments/attacks/adv_attack.py", line 110, in <module>
    run(args)
  File "taskaugment/MTVulnerability/experiments/attacks/adv_attack.py", line 58, in run
    model = load_model(args)
  File "taskaugment/MTVulnerability/experiments/attacks/__init__.py", line 77, in load_model
    model = XceptionTaskonomy(tasks=args.test_task_set)
  File "taskaugment/MTVulnerability/utils/xception_taskonomy_new.py", line 359, in __init__
    m.weight.data.normal_(0, math.sqrt(2. / n))
ZeroDivisionError: float division by zero

The error was an inconsistency in the variable chanels. In some places was spelled channels. I made a small change so the variable is consistently spelled incorrectly :) Then, it was able to load.

Also, when loading state_dict, it did not work without the strict parameter being set to True. So, I used your comment.

Thanks!

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

Successfully merging this pull request may close these issues.

1 participant