lefnire / tforce_btc_trader

TensorForce Bitcoin Trading Bot
http://ocdevel.com/podcasts/machine-learning/26
GNU Affero General Public License v3.0
820 stars 235 forks source link

Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_2/stack_const_axis #33

Open webroboteu opened 6 years ago

webroboteu commented 6 years ago

Hi, where can i find this dependency? from box import Box

lefnire commented 6 years ago

pip install python-box

webroboteu commented 6 years ago

hi i see this: guess there is some other configuration problem but the training starts.

I will study the whole project calmly. I would like to do something similar with other crypts like IOTA

2018-05-05 22:39:26.190851: W tensorflow/core/grappler/optimizers/arithmetic_optimizer.cc:1441] Failed to build SimpleGraphView. 2018-05-05 22:39:26.197183: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:586] Iteration = 0, topological sort failed with message: Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_1/stack_const_axis 2018-05-05 22:39:26.199211: E tensorflow/core/grappler/optimizers/dependency_optimizer.cc:586] Iteration = 1, topological sort failed with message: Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_4/stack_const_axis 2018-05-05 22:39:30.534231: W ./tensorflow/core/grappler/optimizers/graph_optimizer_stage.h:230] Failed to run optimizer ArithmeticOptimizer, stage HoistCommonFactor. Error: Node ppo/observe-timestep/cond/optimization/multi-step/step/while/step/step/loss/regularization-losses/regularization-loss/regularization-loss/ArithmeticOptimizer/HoistCommonFactor_Add_AddN is missing output properties at position :0 (num_outputs=0) 2018-05-05 22:39:30.535865: W ./tensorflow/core/grappler/optimizers/graph_optimizer_stage.h:230] Failed to run optimizer ArithmeticOptimizer, stage HoistCommonFactor. Error: Node ppo/observe-timestep/cond/optimization/multi-step/step_1/while/step/baseline-loss/regularization-loss/regularization-loss/regularization-loss/ArithmeticOptimizer/HoistCommonFactor_Add_AddN is missing output properties at position :0 (num_outputs=0) 2018-05-05 22:39:30.540267: W ./tensorflow/core/grappler/optimizers/graph_optimizer_stage.h:230] Failed to run optimizer ArithmeticOptimizer, stage HoistCommonFactor. Error: Node ppo/observe-timestep/cond/optimization/multi-step/step/subsampling-step/step/adam/step/loss/regularization-losses/layered-network/regularization-loss/linear0/regularization-loss/ArithmeticOptimizer/HoistCommonFactor_Add_AddN is missing output properties at position :0 (num_outputs=0) 2018-05-05 22:39:30.540515: W ./tensorflow/core/grappler/optimizers/graph_optimizer_stage.h:230] Failed to run optimizer ArithmeticOptimizer, stage HoistCommonFactor. Error: Node ppo/observe-timestep/cond/optimization/multi-step/step_1/adam/step/baseline-loss/network-baseline/regularization-loss/layered-network/regularization-loss/linear0/regularization-loss/ArithmeticOptimizer/HoistCo

lefnire commented 6 years ago

Sorry for the AWOL, I've been pretty busy w/ work and won't have time again for serious devotion to this project until July. (The upside is my work is in stocks, so I have lots of lessons to bring to bare when I return).

This looks like a versions issue. Tensorflow vs TensorForce or the like. Try poking around TensorForce, see what version they're using; or what version of tensorflow/tensorforce were released in my last commit. If that is the issue, do me a huge favor and submit a PR with pinned versions that work

AxKo commented 6 years ago

Hi, I'm working with Tensorforce on a different project, but get the same error as webroboteu, so I wonder if you found out what the problem is !? I'm under Windows using Py3.6, Tensorflow 1.8 & Tensorforce 0.4.2.

2018-05-14 13:52:01.632536: W T:\src\github\tensorflow\tensorflow\core\grappler\optimizers\arithmetic_optimizer.cc:1441] Failed to build SimpleGraphView. 2018-05-14 13:52:01.636537: E T:\src\github\tensorflow\tensorflow\core\grappler\optimizers\dependency_optimizer.cc:586] Iteration= 0, topological sort failed with message: Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_1/stack_const_axis 2018-05-14 13:52:01.640537: E T:\src\github\tensorflow\tensorflow\core\grappler\optimizers\dependency_optimizer.cc:586] Iteration= 1, topological sort failed with message: Non-existent input ^ConstantFoldingCtrl/ppo/cond/add/Switch_0 for node ConstantFolding/ppo/cond/strided_slice_2/stack_const_axis

soumitr-shipmnts commented 6 years ago

Hi @AxKo @lefnire , Even I am facing the same issue. If you got some solution about it then do post it.

lbarberiscanoni commented 6 years ago

Having the same issue.

Interestingly enough, I don't have the issue when I run a basic version of a Tensorforce agent straight from the Python interpreter. When I use the interpreter, I get a message confirming the graph is built, and then I run one iteration and it works. When I run the agent from a script, that's when I get the error.

I wonder if the error has anything to do with the sequence of events itself, since in pure Tensorflow the only thing running is the computational graph, so the rest of the code waits to be executed until the graph is built (at least that's my understanding), whereas when we use Tensorforce our program may try to execute lines before Tensorflow has concluded setting up the agent in the background.

Also, I am not even sure that the error is actually causing an issue because despite the error the agent is able to come up with action and observe its reward. Regardless, I'd love a clarification as well.

soumitr-shipmnts commented 6 years ago

@AxKo @lbarberiscanoni We can get rid of that tensorflow error if we change the version from 1.8 to 1.7.

melaanya commented 6 years ago

@soumitr-shipmnts thank you! @AxKo @lbarberiscanoni same problem in a different project using Tensorflow 1.8, switching to 1.7 solves the issue.

anpark commented 6 years ago

same question for me!

xpandi-top commented 6 years ago

i have similar question

lefnire commented 6 years ago

Just pushed a bug fix renaming execute() arg actions => action, per latest tensorforce code. The Switch_0 stuff looks like a bug in TensorForce's summarizer code. The code seems to run regardless, just that you won't be able to use their summarizer functionality (we aren't using it). https://github.com/reinforceio/tensorforce/issues/415 I'll report back if I find any more.