Comments (11)
Random seed is not fixed for environment , It is a possible reason that train test fails sometimes.
Any other case fails except TrainTest ?
from alf.
And there are other reasons:
- multiple threads are used for parallelism between independent operations in tf
- the order of running op are uncertain (when they have no dependencies)
perharps we should set tf.config.threading.set_inter_op_parallelism_threads(1)
for unittest
from alf.
Random seed is not fixed for environment , It is a possible reason that train test fails sometimes.
Any other case fails except TrainTest ?
Sometimes the SAC case will also fail.
from alf.
And there are other reasons:
- multiple threads are used for parallelism between independent operations in tf
- the order of running op are uncertain (when they have no dependencies)
perharps we should set
tf.config.threading.set_inter_op_parallelism_threads(1)
for unittest
I think for unittest, to avoid stochasticity introduced by parallelism, we can set num_envs=1 and not use async-off policy training.
from alf.
It's hard to make the training have deterministic result, i did some experiments
with fixed seed for tf and environments and set inter_op_parallelism_threads
to 1 , the result shows it still has the probability of getting different results
Personally think, it's ok when some unittest fails
from alf.
It's hard to make the training have deterministic result, i did some experiments
with fixed seed for tf and environments and setinter_op_parallelism_threads
to 1 , the result shows it still has the probability of getting different resultsPersonally think, it's ok when some unittest fails
OK, I thought the reason why we changed unittest to tf.unittest is because of the determinism it provides. Then maybe next time the test threshold should be less strict.
from alf.
So if everything has fixed random seeds, then the only stochasticity is from CPU scheduling for parallelism, right? What about we use eager mode for unittests?
from alf.
So if everything has fixed random seeds, then the only stochasticity is from CPU scheduling for parallelism, right? What about we use eager mode for unittests?
Yes , the only stochasticity is from CPU scheduling for parallelism, it affect the generation of random numbers. I have tried using eager mode for train test with only 1 thread, but it does not make deterministic result (still do not know the reason)
from alf.
So if everything has fixed random seeds, then the only stochasticity is from CPU scheduling for parallelism, right? What about we use eager mode for unittests?
Yes , the only stochasticity is from CPU scheduling for parallelism, it affect the generation of random numbers. I have tried using eager mode for train test with only 1 thread, but it does not make deterministic result (still do not know the reason)
Hmm.. Interesting. @emailweixu Do you have any insight into this?
from alf.
Using eager mode will make the test much longer.
Perhaps the game itself has some randomness inside?
from alf.
Using eager mode will make the test much longer.
Perhaps the game itself has some randomness inside?
I think @witwolf tried setting the seeds of environments deterministically. Even so, the results are nondeterministic.
from alf.
Related Issues (20)
- Exception from get_nested_field() does not stop the training
- Exclude red-light events triggered after passing the traffic light
- About Allocating Custom Environment HOT 3
- high performance parallel environment (C++ based envppool)
- Apple M1 GPU - PyTorch "mps" backend support HOT 1
- multi-gpu training issue
- Extended sensor suites (obstacle, dynamic object, red-light etc)
- documentation not generated
- Interferenceless Parallel Carla Environment
- API change to policy_trainer._step makes CI stuck without informative error message HOT 1
- Imitation for Driving (code + doc) HOT 1
- How to get to the next step the AlfGymWrapper class HOT 3
- How to get which Vehicle light state of each actor ? HOT 2
- Dormant/Collided vehicles disappear even after commenting lines in ALSM.CPP HOT 2
- Offline Buffer with Disk Storage Option
- Need to upgrade the CI ubuntu version HOT 1
- ModuleNotFoundError: No module named '_cnest' HOT 5
- Need to update pytorch version for better GPU cards HOT 1
- fast parallel env sometimes hangs after ctrl+c
- TypeError: configurable() got an unexpected keyword argument 'whitelist' HOT 10
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 alf.