-
Notifications
You must be signed in to change notification settings - Fork 69
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
Matlab called python Theano Module Wrong #9
Comments
Hi,
Looks like a path problem.
First of all - what Matlab version do you have, and can you import other
(not VIN) python packages?
Second - can you try following the advice on this page:
https://www.mathworks.com/help/matlab/matlab_external/undefined-variable-py-or-function-py-command.html#buiebj2-71
to fix the python path error (seems like you need to add the path to
theano)?
Let me know if this works.
Best,
Aviv
…On Mon, Jan 30, 2017 at 4:57 AM, VeritasPotter ***@***.***> wrote:
Hi! Recently, we tried to reproduce the experiment, but at the
visualization part (script_viz_policy.m) has to use MATLAB call python code
(vin.py). In this part, the code imports theano module (which I have
already installed). But it reported an err:
Undefined variable "py" or class "py.vin.vin".
Error in script_viz_policy (line 3)
tmp = py.vin.vin; clear tmp; % to load Python
And I followed instruction of Matlab Online Help, used command
py.importlib.import_module('vin') for test, and still reported an err:
Error using theano_utils> (line 3)
Python Error: ImportError: No module named theano
Error in vin> (line 3)
from theano_utils import *
Error in *init*>import_module (line 37)
*import*(name)
But I can import theano in python,
import theano
import theano.tensor as T
theano.test()
Theano version 0.8.2
theano is installed in //anaconda/lib/python2.7/site-packages/theano
NumPy version 1.11.1
NumPy relaxed strides checking option: False
NumPy is installed in //anaconda/lib/python2.7/site-packages/numpy
Python version 2.7.12 |Anaconda 4.2.0 (x86_64)| (default, Jul 2 2016,
17:43:17) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build
2336.11.00)]
nose version 1.3.7
I couldn't figure out where is the problem. Thank you in advance!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOeQNcB4WvE3kGRLCjnqeMRkedLks5SJks5rXd4mgaJpZM4LxXww>
.
|
Hi, Aviv! It still doesn't work on Matlab R2016b. I followed the instruction of Matlab documents, added the path into python.
P = Python list with no properties.
I can import my own python file like mymod.py and module like numpy with no problems,
ans = Python module with properties:
ans = Python module with properties:
...... But if I want to import theano or vin.py, it reported errors:
And also, the path for theano is a dictionary, maybe this method only works for a file (Matlab tries to find a file named theano.py?) rather a dictionary. But still, numpy is also a dic, so I am confused. Many thanks, |
I am having a similar problem. is your problem solved? |
Hi! Recently, we tried to reproduce the experiment, but at the visualization part (script_viz_policy.m) has to use MATLAB call python code (vin.py). In this part, the code imports theano module (which I have already installed). But it reported an err:
Undefined variable "py" or class "py.vin.vin".
Error in script_viz_policy (line 3)
tmp = py.vin.vin; clear tmp; % to load Python
And I followed instruction of Matlab Online Help, used command py.importlib.import_module('vin') for test, and still reported an err:
Error using theano_utils> (line 3)
Python Error: ImportError: No module named theano
Error in vin> (line 3)
from theano_utils import *
Error in init>import_module (line 37)
import(name)
But I can import theano in python,
I couldn't figure out where is the problem. Thank you in advance!
The text was updated successfully, but these errors were encountered: