octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Integrating Pytave and Nnet


From: Mike Miller
Subject: Re: Integrating Pytave and Nnet
Date: Mon, 3 Apr 2017 15:00:01 -0700
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Apr 03, 2017 at 09:15:21 -0700, enricobertino wrote:
> Thank you for your answer. Analyzing if there are nested namespaces, I
> discovered that if I import Pandas before Tensorflow doing simply
> 
>  py.__import__("pandas")
>  py.__import__("tensorflow")
> 
> it works! It is very weird because normally Tensorflow does not require the
> import of Pandas and it should work independently.

This does not work for me. I just installed numpy, pandas, and
tensorflow in a new virtualenv, and I still get the original error.

> By any chance, do you
> have an idea about what could be the problem? In which part of Pytave should
> I start to look? 

I looked a little bit into tensorflow and discovered that they do have
some tricky things with modules importing the contents of other modules,
plus there is a nested swig library involved.

However, I took a wild guess that the error about `argv` was referring
to `sys.argv`. Sure enough, if I insert a new property into the `sys`
module, I can access tensorflow without the error:

    >> py.sys.__dict__.__setitem__ ("argv", {""});
    >> py.tensorflow.VERSION
    ans = [Python object of type str]
    
      1.0.1

I have a few questions

  * why does `sys.argv` exist when python the interpreter is run, but
    not when it is embedded in another program?
  * are we not doing some important initialization step?
  * should tensorflow not be accessing sys.argv, is this a bug?

Care to help me look into one or more of these?

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]