-
Notifications
You must be signed in to change notification settings - Fork 631
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
Comments
wulispa
changed the title
你好,能提供一下运行环境信息吗,你的Paddle版本和VisualDL版本分别是多少
运行官方的代码出现Failed to save model graph, error: ''
Mar 17, 2023
是demo的代码吗 |
是的 |
运行graph_test.py成功了应该有一个vdlgraph.xxxxx.log的文件,我刚刚跑了一下我这里没有报错,你那边有没有更详细的错误信息给报出来 |
比如报错的程序堆栈具体在哪一行可以看得到吗 |
# 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) 是跑的这份代码吗 |
是的 |
不清楚原因,等我找一台windows机器复现后回你 |
可以了,谢谢哇 |
修复的pr #1244 。 这个修复将在下一个小版本中进入,如果需要在windows下使用,可以参考这个pr中修改的文件在本地对应修改一下。具体可以安装如下操作: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VisualDL是2.5.1
paddle是2.4.2
The text was updated successfully, but these errors were encountered: