Hi

I included the path while loading .npz for reading as below and now it is
working.

npzfile = np.load('/users/gvelu/ryu/ryu/app/trainingresult.npz')


Thanks

Gandhimathi

On 7 May 2016 at 18:52, Gandhimathi Velusamy <mathiy...@gmail.com> wrote:

> Hi,
>
>     I  have added some functionality in packet-in, when a packet in
> happens it will be sent to classify function which reads some data from a
> .npz file and does some work and classifies tehe packet.
>
> When I run the classifier.py separately which has classify function it
> works for me. But when I run simple_switch_13.py I am getting the following
> error.
>
> SimpleSwitch13: Exception occurred during handler processing. Backtrace
> from offending handler [_packet_in_handler] servicing event
> [EventOFPPacketIn] follows.
>
> Traceback (most recent call last):
>
>   File "/usr/local/lib/python2.7/dist-packages/ryu/base/app_manager.py",
> line 290, in _event_loop
>
>     handler(ev)
>
>   File "/users/gvelus01/ryu/ryu/app/simple_switch_13.py", line 136, in
> _packet_in_handler
>
>     classify(decidata, in_port) # classify and push flow through rest api
>
>   File "/users/gvelus01/ryu/ryu/app/simple_switch_13.py", line 181, in
> classify
>
>     npzfile = np.load('trainingresult.npz')
>
>   File "/usr/lib/python2.7/dist-packages/numpy/lib/npyio.py", line 370, in
> load
>
>     fid = open(file, "rb")
>
> IOError: [Errno 2] No such file or directory: 'trainingresult.npz'
>
>
> The program which writes data into 'trainingresult.npz' , the
> classifier.py which reads the data and simple switch are all in the same
> directory under ryu/ryu/app.
>
>
> When  I started Python interpreter under /ryu/ryu/app directory, and
> tested by loading the .npz file. I am able to read it.
>
> May I please, know how to get rid of the error while running
> simple_switch_13.py?
>
> FYI, I am running Ryu controller as below:
>
>
> @controller:~/ryu$ PYTHONPATH=. ./bin/ryu-manager
> ryu/app/simple_switch_13.py
>
>
> Do I need to set any path?
>
>
> Even I copy pasted the classifier code inside simple_switch_13.py  and
> getting the same error.
>
> Thanks
>
> Gandhimathi
>
>
>
>
>
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to