【问题标题】:Configure Tensorflow for CPU using Java API使用 Java API 为 CPU 配置 Tensorflow
【发布时间】:2018-09-21 12:51:01
【问题描述】:

我尝试使用 intra_op_parallelism_threadsinter_op_parallelism_threads 的数字。我为 Java 使用 Tensorflow 和 Proto 版本 1.8.0。 我使用了以下代码:

     ConfigProto config = ConfigProto.newBuilder()
                            .setInterOpParallelismThreads(44)
                            .setIntraOpParallelismThreads(44).build();

     outputs = model.session().runner().setOptions(config.toByteArray()).
                     feed("image_tensor", input).fetch("detection_scores").fetch("detection_classes").fetch("detection_boxes").fetch("num_detections").run();

当我运行推理时,我收到以下错误:等待通知超时。

我做错了吗?还有其他方法吗?

谢谢

【问题讨论】:

    标签: java tensorflow inference


    【解决方案1】:

    我遇到了同样的问题,这是我的出路。

    SavedModelBundle.loader("model_dir").withTags("tag").withConfigProto(config.toByteArray()).withXX().load();
    

    【讨论】:

      猜你喜欢
      • 2011-02-22
      • 1970-01-01
      • 1970-01-01
      • 2018-07-19
      • 1970-01-01
      • 2018-05-08
      • 2017-11-14
      • 2020-07-26
      • 1970-01-01
      相关资源
      最近更新 更多