Comments (4)
Hi Phil,
Again I think this has to do with the same issue (see here). After a fresh install and modifying your code as follows (I just changed the import for arena_config
and the env.reset(arenas_configurations_input)
):
from animalai.envs import UnityEnvironment
from animalai.envs.arena_config import ArenaConfig
arena_config_in = ArenaConfig('configs/obstacles.yaml')
env_name = 'env/AnimalAI'
train_mode = True
env = UnityEnvironment(file_name=env_name)
default_brain = env.brain_names[0]
brain = env.brains[default_brain]
env_info = env.reset(arenas_configurations_input=arena_config_in, train_mode=train_mode)[default_brain]
action = [[0,0]]
env_info = env.step(action)[default_brain]
print("VISUAL OBS: ",env_info.visual_observations)
input("HIT ME: ")
env.close()
I obtain:
VISUAL OBS: [array([[[[0.19215686, 0.30196078, 0.4745098 ],
[0.19215686, 0.30196078, 0.4745098 ],
[0.19215686, 0.30196078, 0.4745098 ],
...,
[0.44705882, 0.37254902, 0.29019608],
[0.43137255, 0.36078431, 0.2745098 ],
[0.42745098, 0.35686275, 0.26666667]],
[[0.19215686, 0.30196078, 0.4745098 ],
[0.19215686, 0.30196078, 0.4745098 ],
[0.19215686, 0.30196078, 0.4745098 ],
...,
[0.43137255, 0.35686275, 0.26666667],
[0.44705882, 0.36862745, 0.2745098 ],
[0.43529412, 0.36470588, 0.26666667]],
[[0.19215686, 0.30196078, 0.4745098 ],
[0.19215686, 0.30196078, 0.4745098 ],
[0.19215686, 0.30196078, 0.4745098 ],
...,
I will close this issue too, please reopen if you still face this problem after a fresh install.
from animalai-olympics.
from animalai-olympics.
Hi Phil,
The speed at which you will be able to run the environment and train is very dependent on your hardware.
Also, you need to differentiate two things that can take more or less time:
- Taking a single step in the environment
- Training of your algorithm
If I understand your question correctly, your point "1." is regarding training (which library to use to train the agent), and point "2." is related to taking steps in the environment.
Regarding training, you are completely free to implement whichever technique you want using any library you prefer (OpenCV in your case). However, this should not be linked to the performance of the environment and we cannot really help on that side as this part of the challenge is what is required from the participants.
On the environment side, we have optimised the executable as much as possible to prevent the call to env.step()
to be a bottleneck. To test for this, you can try to run a few thousand steps in the environment alone (without any training) and see how long it takes, put this code in your example folder and run it:
from animalai.envs import UnityEnvironment
from animalai.envs.arena_config import ArenaConfig
import numpy as np
import time
env = UnityEnvironment(
n_arenas=1,
file_name='../env/AnimalAI',
worker_id=1,
seed=0,
docker_training=False,
play=False
)
env.reset(arenas_configurations=ArenaConfig('configs/justFood.yaml'))
N = 10000
before = time.time()
for _ in range(N):
env.step(np.random.randint(0, 3, size=2))
after = time.time()
print('Steps per second: {0}'.format(N / (after - before)))
env.close()
on Linux with an i7 and GTX730 I get to 320 steps per second.
Finally, if you wish to re-implement your own communicator and training interface you can do so, but keep in mind that at the time of submission we will expect an agent that implements agent.py
(the syntax of which will most likely change by the launch date).
If you still want to follow this route we will not provide help in any other language than python. I can only encourage you to read and debug the code in animalai/envs
and familiarise yourself with protobuf which is the protocol used to communicate.
Hope this helps,
Benjamin
from animalai-olympics.
from animalai-olympics.
Related Issues (20)
- Website is down HOT 1
- what's the angle of view of the agent? HOT 2
- [beginner's question] how much computing resources are required to train a reasonable model? HOT 2
- Get agent x, y, z position during training HOT 1
- Question about example config files HOT 2
- Can i get the velocity of the agent? HOT 2
- Docker and AWS HOT 5
- Gym Wrapper multi-agent HOT 2
- overtrained? HOT 8
- Question about internal memory category HOT 1
- Instructions for final submissions HOT 2
- Env directory is ignored in .gitignore HOT 1
- Windows ENV cant donwload HOT 1
- Online-world suggestion HOT 1
- Google Colab Run error HOT 1
- Question about the way about curriculum HOT 2
- Windows environment download link HOT 1
- Modify environment assets / make new environment? HOT 1
- Tensorflow 2 compatability HOT 2
- CylinderTunnel and CylinderTunnelTransparent items not showing in the arena
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 animalai-olympics.