Comments (9)
This example should also be included in new unit tests, normally was not tested because it's only for API demo purposes
from tensorforce.
Thanks for the info, I fixed the example code and included the new code in the docs with commit 7d4ead3. The simple q agent should now start.
from tensorforce.
I got a different error this time when running the script:
ValueError: Variable simpleqnetwork/linear1/weights already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "/Users/aidanrocke/anaconda/envs/py3k/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 217, in variable
use_resource=use_resource)
File "/Users/aidanrocke/anaconda/envs/py3k/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/arg_scope.py", line 181, in func_with_args
return func(*args, **current_args)
File "/Users/aidanrocke/anaconda/envs/py3k/lib/python3.6/site-packages/tensorflow/contrib/framework/python/ops/variables.py", line 262, in model_variable
use_resource=use_resource)
I'm using a conda virtual environment(py3k) and Python 3.6
There appears to be a conflict with tensorflow.
from tensorforce.
Hmm, I got yet another error with python 3.5. I'll check for python 3.x compatibility and possibly look into anaconda compatibility some time this week - probably won't make it today or tomorrow, however.
from tensorforce.
I fixed the other issue with python 3.x in 9c6bee4, but that was unrelated to your error.
from tensorforce.
Could not replicate the error using anaconda, everything works for me:
python -V
Python 3.6.0 :: Anaconda 4.3.1 (64-bit)
python tensorforce/examples/simple_q_agent.py
[2017-04-24 14:25:30,683] Making new env: CartPole-v0
2017-04-24 14:25:30.690554: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-24 14:25:30.690602: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-04-24 14:25:30.690616: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-04-24 14:25:30.690629: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
[2017-04-24 14:25:30,816] Starting SimpleQAgent for Environment 'CartPole-v0'
[2017-04-24 14:25:30,857] Finished episode 1 after 24 timesteps
[2017-04-24 14:25:30,857] Episode reward: 24.0
[2017-04-24 14:25:30,858] Average of last 10 rewards: 24.0
[2017-04-24 14:25:31,447] Finished episode 11 after 28 timesteps
[2017-04-24 14:25:31,447] Episode reward: 28.0
[2017-04-24 14:25:31,447] Average of last 10 rewards: 35.5
I'm not familiar with anaconda, so I can only guess. Which TensorFlow version do you use? Do you use a special configuration? Could you try replicating the bug again with a fresh environment?
from tensorforce.
I setup a fresh environment this morning using these instructions and I also keras+tensorflow with tensorflow version 1.1.0
Moreover, to install tensorflow I simply used:
pip install tensorflow # Python 2.7; CPU support (no GPU support)
I followed the instructions on the Mac OSX page.
from tensorforce.
Here's the error I get this time:
runfile('/Users/aidanrocke/Desktop/tensorforce/tensorforce/examples/simple_q_agent.py', wdir='/Users/aidanrocke/Desktop/tensorforce/tensorforce/examples')
[2017-04-24 23:22:24,847] Making new env: CartPole-v0
[2017-04-24 23:22:25,238] Starting SimpleQAgent for Environment 'CartPole-v0'
Traceback (most recent call last):
File "<ipython-input-1-4e18e599c233>", line 1, in <module>
runfile('/Users/aidanrocke/Desktop/tensorforce/tensorforce/examples/simple_q_agent.py', wdir='/Users/aidanrocke/Desktop/tensorforce/tensorforce/examples')
File "/Users/aidanrocke/anaconda/envs/py3k/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "/Users/aidanrocke/anaconda/envs/py3k/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/aidanrocke/Desktop/tensorforce/tensorforce/examples/simple_q_agent.py", line 217, in <module>
main()
File "/Users/aidanrocke/Desktop/tensorforce/tensorforce/examples/simple_q_agent.py", line 213, in main
runner.run(max_episodes, max_timesteps, episode_finished=episode_finished)
File "/Users/aidanrocke/Desktop/tensorforce/tensorforce/execution/runner.py", line 62, in run
self.agent.add_observation(processed_state, action, result['reward'], result['terminal_state'])
File "/Users/aidanrocke/Desktop/tensorforce/tensorforce/agents/memory_agent.py", line 112, in add_observation
if self.step_count >= self.min_replay_size and self.step_count % self.update_steps == 0:
TypeError: '>=' not supported between instances of 'int' and 'NoneType'
It's not clear to me why self.step_count is of type NoneType at some point but this is the error I'm getting.
from tensorforce.
solved in gitter
from tensorforce.
Related Issues (20)
- Gym envirnoment broken: 'dict' object has no attribute 'env_specs HOT 3
- Issues installing Tensorforce from pip on Python 3.10
- is it still active? HOT 2
- How to change epsilon value when using epsilon-greedy policy? HOT 2
- Can I customize the loss function?
- Saver documentation inconsistent with example
- End-to-end data collection and policy updates on the GPU possible with tensorforce
- how to modify the loss function of the value network in PPO
- AttributeError: 'Adam' object has no attribute '_create_all_weights' HOT 3
- Why different models performs the same HOT 1
- AttributeError: type object 'Module' has no attribute '_MODULE_STACK' HOT 1
- tensorforce.exception.TensorforceError: Invalid value for variable argument spec: TensorSpec HOT 1
- Comparison of "online" and "offline" agent-enviroment interactions
- error creating an agent
- TypeError: CCompiler_spawn() got an unexpected keyword argument 'env' HOT 2
- A minimal example of custom Environment fails on protobuf or dtensor import from tensorflow.compat.v2.experimental HOT 6
- How to specify min_value and max_value in a custom environment when shape of the state is a vector? HOT 1
- Does Runner.run perform training given it never invokes agent.experience(...) ? HOT 1
- logging to logdir for tensorboard? HOT 1
- Some issue about PPOAgent update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorforce.