Comments (3)
@huzhoudaxia Very good question. Basically, the get_batch is getting a batch of samples instead of one sample. After getting all the samples, it will send the signals to the free_queue. Since there are multiple threads, there could be some weird cases. Let me give you an example:
Suppose we use 4 threads, the batch size is 32, and the number of buffers is 50. The four threads all request 32 samples (and they will only send free signals after getting 32 samples). Suppose at some time step, they get, 12, 12, 12, and 14 samples, respectively. At this time step, the program will get stuck since the buffers have not been freed.
Thus, we add a lock here to make getting 32 samples atomic.
from douzero.
@daochenzha Thank you for your time. Your answer is very helpful.
from douzero.
similar to the Dining Philosophers Problem
from douzero.
Related Issues (20)
- 为什么同样是4个GPU我的训练时候的FPS很低呢,基本都在2000左右 HOT 7
- 关于models.py 几个问题 HOT 7
- 抢地主功能什么时候开放 HOT 1
- 求助,用CPU无法训练问题!!! HOT 1
- 策略调整可行性 HOT 2
- 执行loss.backward()几个小时报错out of memory HOT 7
- 策略可能性
- 咨询下LSTM策略调整
- 多显卡瓶颈在第0卡上
- Apple M1芯片支持模拟和训练吗 HOT 1
- colab上的训练代码一运行,ram就炸了 HOT 3
- 欢乐斗地主实测胜率很低 算法还有升级的办法吗? HOT 2
- 关于深度学习与强化学习 HOT 2
- 一点想法 关于不洗牌模式的训练 HOT 9
- 另外,训练过程中注意CPU和显存 我是actor用CPU,training用GPU,CPU一定要留余地,同时thread不要加太高 否则容易爆显存
- actor网络在收集数据时使用了model前向传播,leaner对网络参数再进行跟新,这两者对同一共享内存更新是否会有冲突? HOT 1
- 勾吧pretrain models都没有 一训练全是0 HOT 2
- 在colab在跑训练,时间到了可以从上一次继续么 HOT 1
- EOFError: Ran out of input HOT 2
- 想询问一下baseline里面的ai训练了多久,我训练了几个礼拜了,表现感觉不如baseline HOT 2
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 douzero.