发现saved_model.go导入路径出错 [英] I found that there is an error import path in saved_model.go

查看:36
本文介绍了发现saved_model.go导入路径出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:

在github:

import (运行"不安全"github.com/golang/protobuf/proto"tfpbgithub.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core")

这是什么(tfpbgithub.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core")?我在任何地方都找不到它,我的程序也可以我该如何解决这个问题

有详细说明:今天我尝试为Go安装tensorflow并执行它,我使用这个cmd:

去github.com/tensorflow/tensorflow/tensorflow/go

然后我测试 tf for go:

去测试github.com/tensorflow/tensorflow/tensorflow/go

(根据本网站:tensorflow)

但我收到了这条消息:

<块引用>

在以下任何一个中找不到包github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core":/home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core(来自$GOROOT)

/home/go_work/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core(来自$GOPATH)

然后我访问github然后我找不到这个路径,我该如何解决这个问题?谢谢你们.

解决方案

你可以在 Github 上查看类似的 issue:23257

因此,没有记录在案的适当修复程序,在那之前您可以尝试一下.我使用以下方式解决了我的错误:

  1. 运行 go get github.com/tensorflow/tensorflow/tensorflow/go

package github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core:找不到包github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core"中的任何一个:/usr/local/Cellar/go/1.13.5/libexec/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core(来自$GOROOT)/Users/subhamsarkar/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core(来自$GOPATH)

  1. 上面的 get 肯定找不到所说的包,但是 repo 已经克隆到你的 GOPATH
  2. cd $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/go
  3. git checkout r1.11

现在再次运行,

  1. 去github.com/tensorflow/tensorflow/tensorflow/go

<块引用>

原因:讨论

此外,我相信您已经安装了 TensorFlow Go 包 所需的 TensorFlow C 库.

注意:我在

上测试过<块引用>

操作系统:MacOSX 10.15.2
Go 版本:go1.13.5 darwin/amd64

problem:

in github:

import (
    "runtime"
    "unsafe"

    "github.com/golang/protobuf/proto"

    tfpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core"
)

what's this(tfpb "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core") ? I cannot find it in anywhere , so can my program How can I solve this problem

there is details: today I try to install tensorflow for Go and execute it, I use this cmd:

go get github.com/tensorflow/tensorflow/tensorflow/go

then i test tf for go:

go test github.com/tensorflow/tensorflow/tensorflow/go

(according with this site: tensorflow)

but i got this message:

cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core" in any of: /home/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOROOT)

/home/go_work/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOPATH)

then i visit github then i cannot find this path , How can I solve this problem? thanks for you guys.!

解决方案

You can look at the similar issue on Github: 23257

So, there's no proper fix out there which is documented, until then you can try this out. I resolved my error using the following way:

  1. Run go get github.com/tensorflow/tensorflow/tensorflow/go

package github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core: cannot find package "github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core" in any of:
    /usr/local/Cellar/go/1.13.5/libexec/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOROOT)
    /Users/subhamsarkar/go/src/github.com/tensorflow/tensorflow/tensorflow/go/genop/internal/proto/github.com/tensorflow/tensorflow/tensorflow/go/core (from $GOPATH)

  1. Above get surely fails to find the said package, but the repo is already cloned to your GOPATH
  2. cd $GOPATH/src/github.com/tensorflow/tensorflow/tensorflow/go
  3. git checkout r1.11

Now again run,

  1. go get github.com/tensorflow/tensorflow/tensorflow/go

Reason: Discussion

Also, I believe you have installed the TensorFlow C library which is required for the TensorFlow Go package.

Note: I tested on

OS: MacOSX 10.15.2
Go version: go1.13.5 darwin/amd64

这篇关于发现saved_model.go导入路径出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆