-
Notifications
You must be signed in to change notification settings - Fork 165
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
【PPSCI Export&Infer No.21】tempoGAN #884
【PPSCI Export&Infer No.21】tempoGAN #884
Conversation
Thanks for your contribution! |
examples/tempoGAN/tempoGAN.py
Outdated
|
||
# load pretrained model | ||
solver = ppsci.solver.Solver( | ||
model=model_gen, pretrained_model_path=cfg.INFER.pretrained_model_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在的pretrained模型保存的时候保存的是ModelList,因此尽管推理时只用到Generator,在加载模型时也需要加载整个ModelList,否则parmeters的变量名会与pretrained模型中不同,进而导致实际上没有正确加载到参数
因此,参考evaluate,在export中增加:
# define model_list
model_list = ppsci.arch.ModelList((model_gen,))
并将这一行中的model_gen
改成model_list
:
solver = ppsci.solver.Solver(
model=model_list, pretrained_model_path=cfg.INFER.pretrained_model_path
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你好,我也是尝试过的,但还是一样的报错
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的好的 我还以为 还可以把 solver.export(input_spec, cfg.INFER.export_path, skip_prune_program=True) 中的 skip_prune_program删掉,我确实没试过,跳过剪枝后,用model_list,谢谢 辛苦了,是我疏忽了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的好的 我还以为 还可以把 solver.export(input_spec, cfg.INFER.export_path, skip_prune_program=True) 中的 skip_prune_program删掉,我确实没试过,跳过剪枝后,用model_list,谢谢 辛苦了,是我疏忽了
这个是模型导出的一个选项,个别案例如 viv,需要加这个。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* add tempoGAN export&infer * fix tempoGAN.md * fix tempoGAN.md * fix tempoGAN.py
PR types
Others
PR changes
Others
Describe