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

运行官方的代码出现Failed to save model graph, error: '' #1234

Closed
wulispa opened this issue Mar 17, 2023 · 12 comments
Closed

运行官方的代码出现Failed to save model graph, error: '' #1234

wulispa opened this issue Mar 17, 2023 · 12 comments

Comments

@wulispa
Copy link

wulispa commented Mar 17, 2023

VisualDL是2.5.1
paddle是2.4.2

@wulispa wulispa changed the title 你好,能提供一下运行环境信息吗,你的Paddle版本和VisualDL版本分别是多少 运行官方的代码出现Failed to save model graph, error: '' Mar 17, 2023
@rainyfly
Copy link
Collaborator

是demo的代码吗

@wulispa
Copy link
Author

wulispa commented Mar 17, 2023

是的

@wulispa
Copy link
Author

wulispa commented Mar 17, 2023

是demo的代码吗

图片
有生成文件

@rainyfly
Copy link
Collaborator

运行graph_test.py成功了应该有一个vdlgraph.xxxxx.log的文件,我刚刚跑了一下我这里没有报错,你那边有没有更详细的错误信息给报出来

@rainyfly
Copy link
Collaborator

比如报错的程序堆栈具体在哪一行可以看得到吗

@wulispa
Copy link
Author

wulispa commented Mar 17, 2023

图片
这个嘛

@rainyfly
Copy link
Collaborator

rainyfly commented Mar 17, 2023

# Copyright (c) 2022 VisualDL Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =======================================================================
import paddle
import paddle.nn as nn
import paddle.nn.functional as F

from visualdl import LogWriter


class MyNet(nn.Layer):
    def __init__(self):
        super(MyNet, self).__init__()
        self.conv1 = nn.Conv2D(
            in_channels=1, out_channels=20, kernel_size=5, stride=1, padding=2)
        self.max_pool1 = nn.MaxPool2D(kernel_size=2, stride=2)
        self.conv2 = nn.Conv2D(
            in_channels=20,
            out_channels=20,
            kernel_size=5,
            stride=1,
            padding=2)
        self.max_pool2 = nn.MaxPool2D(kernel_size=2, stride=2)
        self.fc = nn.Linear(in_features=980, out_features=10)

    def forward(self, inputs):
        x = self.conv1(inputs)
        x = F.relu(x)
        x = self.max_pool1(x)
        x = self.conv2(x)
        x = F.relu(x)
        x = self.max_pool2(x)
        x = paddle.reshape(x, [x.shape[0], -1])
        x = self.fc(x)
        return x


net = MyNet()
with LogWriter(logdir="./log/graph_test/") as writer:
    writer.add_graph(
        model=net,
        input_spec=[paddle.static.InputSpec([-1, 1, 28, 28], 'float32')],
        verbose=True)

是跑的这份代码吗

@wulispa
Copy link
Author

wulispa commented Mar 17, 2023

是的

@rainyfly
Copy link
Collaborator

不清楚原因,等我找一台windows机器复现后回你

@GuoQuanhao
Copy link

GuoQuanhao commented Mar 17, 2023

我也有这个问题,我这样解决了/~https://github.com/PaddlePaddle/VisualDL/pull/1233,我也是windows

@wulispa
Copy link
Author

wulispa commented Mar 17, 2023

我也有这个问题,我这样解决了/~https://github.com/PaddlePaddle/VisualDL/pull/1233,我也是windows

可以了,谢谢哇

@wulispa wulispa closed this as completed Mar 17, 2023
@rainyfly
Copy link
Collaborator

rainyfly commented Apr 2, 2023

修复的pr #1244 。 这个修复将在下一个小版本中进入,如果需要在windows下使用,可以参考这个pr中修改的文件在本地对应修改一下。具体可以安装如下操作:
import visualdl
visualdl.path
看一下visualdl的安装路径,然后找到pr中修改的文件对应修改一下即能够生效。

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

3 participants