Import tensorflow contrib module is slow in tensorflow 1.2.1

半城伤御伤魂 提交于 2019-12-11 06:27:56

问题


Is there a reason for the tensorflow contrib module imports being slower in 1.2.1 than 1.1.0? I am using Python 3.5.

The overhead is not significant using the command-line, its perhaps around 2-3 seconds. However in an IDE, it becomes quite significant (~ 10 seconds to import tensorflow.contrib as opposed to (~0.5 seconds) in tensorflow 1.1.0.

Thanks in advance.


回答1:


It is slow to import because it is doing inspect.stack() many times, which take a lot of time each time. I have reported this issue, and have submitted a PR with a fix.



来源:https://stackoverflow.com/questions/45093653/import-tensorflow-contrib-module-is-slow-in-tensorflow-1-2-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!