Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

mx.symbol.LeakyRelu could not be visualized #10416

Closed
NKUCodingCat opened this issue Apr 5, 2018 · 3 comments · Fixed by #14425
Closed

mx.symbol.LeakyRelu could not be visualized #10416

NKUCodingCat opened this issue Apr 5, 2018 · 3 comments · Fixed by #14425

Comments

@NKUCodingCat
Copy link

Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.

For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io

Description

AS TITLE

net = mx.symbol.LeakyReLU(net)
mx.viz.plot_network(net).view()

Environment info (Required)

----------Python Info----------
('Version      :', '2.7.14')
('Compiler     :', 'MSC v.1500 32 bit (Intel)')
('Build        :', ('v2.7.14:84471935ed', 'Sep 16 2017 20:19:30'))
('Arch         :', ('32bit', 'WindowsPE'))
------------Pip Info-----------
('Version      :', '9.0.1')
('Directory    :', 'C:\\Python27\\lib\\site-packages\\pip'Traceback (most recent call last):
  File "diag.py", line 168, in <module>
    check_pip()
  File "diag.py", line 96, in check_pip
    print('Directory    :', os.path.dirname(pip.__file__))
IOError: [Errno 2] No such file or directory

C:\Users\jingtao\Desktop\Chem-CNN\CNN_MXNET>py -2 diag.py
----------Python Info----------
('Version      :', '2.7.14')
('Compiler     :', 'MSC v.1500 32 bit (Intel)')
('Build        :', ('v2.7.14:84471935ed', 'Sep 16 2017 20:19:30'))
('Arch         :', ('32bit', 'WindowsPE'))
------------Pip Info-----------
('Version      :', '9.0.1')
('Directory    :', 'C:\\Python27\\lib\\site-packages\\pip')
----------MXNet Info-----------
('Version      :', '1.0.0')
('Directory    :', 'C:\\Python27\\lib\\site-packages\\mxnet')
('Commit Hash   :', '9ef196909ec7bf9cdda66d5b97c92793109798e1')
----------System Info----------
('Platform     :', 'Windows-10-10.0.16299')
('system       :', 'Windows')
('node         :', 'DESKTOP-H37P4P8')
('release      :', '10')
('version      :', '10.0.16299')
----------Hardware Info----------
('machine      :', 'AMD64')
('processor    :', 'AMD64 Family 23 Model 1 Stepping 1, AuthenticAMD')
Name
AMD Ryzen 5 1600X Six-Core Processor

----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0660 sec, LOAD: 1.9590 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0220 sec, LOAD: 0.4010 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.0010 sec, LOAD: 1.1470 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0000 sec, LOAD: 0.2360 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.0240 sec, LOAD: 0.1400 sec.
Error open Gluon Tutorial(cn): https://zh.gluon.ai, <urlopen error [Errno 10054] >, DNS finished in 0.000999927520752 sec.
What to do:
1. Download the diagnosis script from https://raw.githubusercontent.com/apache/incubator-mxnet/master/tools/diagnose.py
2. Run the script using `python diagnose.py` and paste its output here.

Compiler (gcc/clang/mingw/visual studio):

MXNet commit hash:
Using mxnet in pip

Build config:
Using mxnet in pip

Error Message:

Traceback (most recent call last):
  File "O_m3.py", line 46, in <module>
    mx.viz.plot_network(x).view()
  File "C:\Python27\lib\site-packages\mxnet\visualization.py", line 305, in plot_network
    label = r"%s\n%s" % (op, node["attrs"]["act_type"])
KeyError: 'attrs'

Minimum reproducible example

(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)

Steps to reproduce

(Paste the commands you ran that produced the error.)

What have you tried to solve it?

@reminisce
Copy link
Contributor

Probably because you didn't specify the params of LeakyReLU and all the params use the default values. In this case, there is no attrs json key in the symbol output format for this operator. It's a bug of plot_network not handling this situation well.

We encourage you to try this MXBoard which is feature richer and handles this situation correctly.

import mxnet as mx
from mxboard import SummaryWriter


data = mx.sym.Variable('data')
lr = mx.sym.LeakyReLU(data)
with SummaryWriter(logdir='./logs') as sw:
    sw.add_graph(lr)

image

@vandanavk
Copy link
Contributor

@NKUCodingCat did mxboard work for you?
Please update/close this issue if it is resolved on your setup.

@NKUCodingCat
Copy link
Author

hmmm I had been given up working on AI for a long time
but I still happy to see such issue fixed, Thanks @vandanavk , sorry for missing you previous message

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants