[Tensorflow and CasADi]: GPflow 2

151 views
Skip to first unread message

antoine...@gmail.com

unread,
Dec 14, 2020, 8:49:44 PM12/14/20
to CasADi
Hello,

I am trying to run the examples from the blog but I am running into issues, possibly because of a newer version of GPflow.

I could upgrade and successfully run tensorflow_casadi.py, gpflow_example.py, and ocp.py but ocp_faster.py keeps on giving me the following error (see code here):

NotImplementedError: Cannot convert a symbolic Tensor (concat_2:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported.

I am a newbie to tensorflow so I have troubles debugging that. There might be a few .numpy() missing but I haven't found where.

Any thoughts would be welcome as I would like to have a working version before trying to implement an ANN with keras.

A couple of remarks:
  1. I had to use an older version of tensorflow to use the placeholders
    1. import tensorflow.compat.v1 as tf
      tf.disable_v2_behavior()
  2. Running ocp.py seems more efficient than described in the blog. I needed 782 calls to the callback (<10s). The resulting plot looks different too.
Thanks a lot in advance,

Best,
Antoine


GPrathap

unread,
Jan 24, 2022, 2:00:38 PM1/24/22
to CasADi
Is there any update on this,  I am having the same error 

Thanks,
Geesara
Reply all
Reply to author
Forward
0 new messages