Skip to content
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

AttributeError: 'LogWriter' object has no attribute 'add_graph' #1210

Open
jannicaTan opened this issue Feb 10, 2023 · 2 comments
Open

AttributeError: 'LogWriter' object has no attribute 'add_graph' #1210

jannicaTan opened this issue Feb 10, 2023 · 2 comments

Comments

@jannicaTan
Copy link

您好,在aistudio中想添加使用add_graph查看动态模型,但是显示为这个错误
visualDL版本为2.2.3 在2.2.0也是相同问题
但是使用add_scalar是可以正常查看的
self.visualizer.add_scalar(tag="train/" + key, value=val, step=self.iteration - 1)

相关代码如下:

Part1:
visualmodel= LogWriter(logdir=str(self.model_dir))
self.visualmodel = visualmodel

Part2:
self.visualmodel.add_graph(
                    model=model,
                    input_spec = [
                        paddle.static.InputSpec(shape=[1, None, model_conf.input_dim],
                                    dtype='float32'),  # audio, [B,T,D]
                        paddle.static.InputSpec(shape=[1],
                                    dtype='int64'),  # audio_length, [B]
                    ],
                     step=self.epoch)
@rainyfly
Copy link
Collaborator

你好,这个接口在VDL v2.3.0之后才加入进去的,这边建议使用pip install visualdl==2.4.2 进行使用这个接口。

@jannicaTan
Copy link
Author

好的感谢!是有用的!

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

No branches or pull requests

2 participants