google / google/python-fire

bugs when use pytorch

未關閉
#206 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
28.2k
分支
1.5k
PR 合併指標
30 天內沒有已合併 PR

描述

Traceback (most recent call last):
File "multilabel/runners/resnet_runner.py", line 26, in
main()
File "multilabel/runners/resnet_runner.py", line 22, in main
fire.Fire(resnet50)
File "/usr/local/lib/python3.6/dist-packages/fire/core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/usr/local/lib/python3.6/dist-packages/fire/core.py", line 560, in _Fire
treatment='callable')
File "/usr/local/lib/python3.6/dist-packages/fire/core.py", line 675, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in __call__
result = self.forward(*input, **kwargs)
TypeError: forward() missing 1 required positional argument: 'x'

When I rewrite pytorch nn.Module, I use x as params to override forward function. This bugs appear.
I have test. If I do not use Fire, it works well.
I suppose that because fire did not support this kind of override? Or someone can tell me how to fix it.
Thanks.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。