问题
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