【发布时间】:2019-04-15 22:16:13
【问题描述】:
我正在尝试使用在 MacOS 上构建的 this 将 TensorFlow 包含在我的 Scala 项目中。
至于installation,他们提供了两种方式:
1) 在 SBT 构建中包含以下行:
libraryDependencies += "org.platanios" % "tensorflow" % "0.4.0" classifier "darwin-cpu-x86_64"
但是这并没有构建并给出以下错误:
unresolved dependency: org.platanios#tensorflow;0.4.0: not found
2) 从头开始构建 TensorFlow(我通过以下步骤完成):
克隆 tensorflow git 存储库
结帐分支 r1.12
运行
./configure使用 bazel 和以下命令构建:
bazel build --config=opt --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0 //tensorflow:libtensorflow.so在 LD_LIBRARY_PATH 中的目录中添加 libtensorflow.so
使用 brew 安装 protobuf
但是,当我想在我的项目中导入 tensorflow 时仍然没有成功。
关于如何解决这个问题的任何想法?
【问题讨论】:
-
根据第 1 点)尝试使用
tensorflow_2.12而不仅仅是tensorflow -
有效!非常感谢,您可以将您的解决方案作为答案,以便我将其标记为正确。
-
只是好奇,你能试试这个,看看它是否有效?
libraryDependencies += "org.platanios" %% "tensorflow" % "0.4.0" classifier "darwin-cpu-x86_64"所以在组织和名称之间是%%,而不是单个%。 -
你可以试试
libraryDependencies += "org.platanios" % "tensorflow_2.12" % "0.4.0" classifier "darwin-cpu-x86_64"或libraryDependencies += "org.platanios" % "tensorflow_2.12" % "0.4.0" -
@KevinLee 也可以,谢谢。
标签: macos scala tensorflow sbt