首页 > 解决方案 > 在pycharm中使用display.Image时看不到图像

问题描述

workspace.SwitchWorkspace("net_test", True)
print("Current blobs in the workspace: {}".format(workspace.Blobs()))
net = core.Net("my_first_net")
print("Current network proto:\n{}".format(net.Proto()))
X = net.GaussianFill([], ["X"], mean=0.0, std=1.0, shape=[2, 3], run_once=0)
print("New network proto:\n{}".format(net.Proto()))
W = net.GaussianFill([], ["W"], mean=0.0, std=1.0, shape=[5, 3], run_once=0)
b = net.ConstantFill([], ["b"], shape=[5, ], value=1.0, run_once=0)
Y = net.FC([X, W, b], ["Y"])
print("Current network proto:\n\n{}".format(net.Proto()))
graph = net_drawer.GetPydotGraph(net, rankdir="LR")
display.Image(graph.create_png(), width=800)

当我测试caffe2时,我使用上面的代码来查看网络结构。但它没有显示图像。这就是我得到的。<IPython.core.display.Image object>那么我怎样才能得到图像呢?顺便说一句,我使用 PyCharm 和 iPython 来执行它。

标签: pycharmipythoncaffe2

解决方案


推荐阅读