Why is TF Keras inference way slower than Numpy operations?

前端 未结 3 1036
挽巷
挽巷 2021-02-05 14:38

I\'m working on a reinforcement learning model implemented with Keras and Tensorflow. I have to do frequent calls to model.predict() on single inputs.

While testing infe

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 14:45

    A little late, but maybe useful for someone:

    Replace model.predict(X) with model.predict(X, batch_size=len(X))

    That should do it.

提交回复
热议问题