tensorflow1.13,gpu版本,导入时错误,无法找到指定模块

tensorflow1.13 cuda 10.1 cudnn 7.5 python3.6
tensorflow直接用pip安装的,普通的CPU版本没有问题,就是GPU版本会出现这个错误
图片说明

重新安装过好多遍了,显卡驱动也更新了
用的是笔记本,双显卡,gtx960M

3个回答

cudnn版本和cuda不匹配,或者不兼容,你一定要找对应的版本,或者你试着直接修改下cudnn对应dll的文件名(但是可能不稳定)

shiro_code
shiro_code cudnn我是直接在官网找的对应cuda10.1版本的,应该不会不匹配才对啊
大约一年之前 回复

跟楼主一样的问题, cuda 10.1.105, cudnn10.1.105, , tensorRt5.0.4.3, 安装 tensorflow_gpu-1.13.1 的版本, 提示错误, 跟楼主一样.
折腾了一天, 也没啥进展.

降低版本吧,参考对应版本,没看到有1.13版本的对应呀

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
安装tensorflow1.13 环境闪退

用conda安装的,打开的时候,有如下显示,而且闪退 ![图片说明](https://img-ask.csdn.net/upload/201904/01/1554109302_5018.png)

tensorflow模型推理,两个列表串行,输出结果是第一个列表的循环,新手求教

tensorflow模型推理,两个列表串行,输出结果是第一个列表的循环,新手求教 ``` from __future__ import print_function import argparse from datetime import datetime import os import sys import time import scipy.misc import scipy.io as sio import cv2 from glob import glob import multiprocessing os.environ["CUDA_VISIBLE_DEVICES"] = "0" import tensorflow as tf import numpy as np from PIL import Image from utils import * N_CLASSES = 20 DATA_DIR = './datasets/CIHP' LIST_PATH = './datasets/CIHP/list/val2.txt' DATA_ID_LIST = './datasets/CIHP/list/val_id2.txt' with open(DATA_ID_LIST, 'r') as f: NUM_STEPS = len(f.readlines()) RESTORE_FROM = './checkpoint/CIHP_pgn' # Load reader. with tf.name_scope("create_inputs") as scp1: reader = ImageReader(DATA_DIR, LIST_PATH, DATA_ID_LIST, None, False, False, False, None) image, label, edge_gt = reader.image, reader.label, reader.edge image_rev = tf.reverse(image, tf.stack([1])) image_list = reader.image_list image_batch = tf.stack([image, image_rev]) label_batch = tf.expand_dims(label, dim=0) # Add one batch dimension. edge_gt_batch = tf.expand_dims(edge_gt, dim=0) h_orig, w_orig = tf.to_float(tf.shape(image_batch)[1]), tf.to_float(tf.shape(image_batch)[2]) image_batch050 = tf.image.resize_images(image_batch, tf.stack([tf.to_int32(tf.multiply(h_orig, 0.50)), tf.to_int32(tf.multiply(w_orig, 0.50))])) image_batch075 = tf.image.resize_images(image_batch, tf.stack([tf.to_int32(tf.multiply(h_orig, 0.75)), tf.to_int32(tf.multiply(w_orig, 0.75))])) image_batch125 = tf.image.resize_images(image_batch, tf.stack([tf.to_int32(tf.multiply(h_orig, 1.25)), tf.to_int32(tf.multiply(w_orig, 1.25))])) image_batch150 = tf.image.resize_images(image_batch, tf.stack([tf.to_int32(tf.multiply(h_orig, 1.50)), tf.to_int32(tf.multiply(w_orig, 1.50))])) image_batch175 = tf.image.resize_images(image_batch, tf.stack([tf.to_int32(tf.multiply(h_orig, 1.75)), tf.to_int32(tf.multiply(w_orig, 1.75))])) ``` 新建网络 ``` # Create network. with tf.variable_scope('', reuse=False) as scope: net_100 = PGNModel({'data': image_batch}, is_training=False, n_classes=N_CLASSES) with tf.variable_scope('', reuse=True): net_050 = PGNModel({'data': image_batch050}, is_training=False, n_classes=N_CLASSES) with tf.variable_scope('', reuse=True): net_075 = PGNModel({'data': image_batch075}, is_training=False, n_classes=N_CLASSES) with tf.variable_scope('', reuse=True): net_125 = PGNModel({'data': image_batch125}, is_training=False, n_classes=N_CLASSES) with tf.variable_scope('', reuse=True): net_150 = PGNModel({'data': image_batch150}, is_training=False, n_classes=N_CLASSES) with tf.variable_scope('', reuse=True): net_175 = PGNModel({'data': image_batch175}, is_training=False, n_classes=N_CLASSES) # parsing net parsing_out1_050 = net_050.layers['parsing_fc'] parsing_out1_075 = net_075.layers['parsing_fc'] parsing_out1_100 = net_100.layers['parsing_fc'] parsing_out1_125 = net_125.layers['parsing_fc'] parsing_out1_150 = net_150.layers['parsing_fc'] parsing_out1_175 = net_175.layers['parsing_fc'] parsing_out2_050 = net_050.layers['parsing_rf_fc'] parsing_out2_075 = net_075.layers['parsing_rf_fc'] parsing_out2_100 = net_100.layers['parsing_rf_fc'] parsing_out2_125 = net_125.layers['parsing_rf_fc'] parsing_out2_150 = net_150.layers['parsing_rf_fc'] parsing_out2_175 = net_175.layers['parsing_rf_fc'] # edge net edge_out2_100 = net_100.layers['edge_rf_fc'] edge_out2_125 = net_125.layers['edge_rf_fc'] edge_out2_150 = net_150.layers['edge_rf_fc'] edge_out2_175 = net_175.layers['edge_rf_fc'] # combine resize parsing_out1 = tf.reduce_mean(tf.stack([tf.image.resize_images(parsing_out1_050, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out1_075, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out1_100, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out1_125, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out1_150, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out1_175, tf.shape(image_batch)[1:3,])]), axis=0) parsing_out2 = tf.reduce_mean(tf.stack([tf.image.resize_images(parsing_out2_050, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out2_075, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out2_100, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out2_125, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out2_150, tf.shape(image_batch)[1:3,]), tf.image.resize_images(parsing_out2_175, tf.shape(image_batch)[1:3,])]), axis=0) edge_out2_100 = tf.image.resize_images(edge_out2_100, tf.shape(image_batch)[1:3,]) edge_out2_125 = tf.image.resize_images(edge_out2_125, tf.shape(image_batch)[1:3,]) edge_out2_150 = tf.image.resize_images(edge_out2_150, tf.shape(image_batch)[1:3,]) edge_out2_175 = tf.image.resize_images(edge_out2_175, tf.shape(image_batch)[1:3,]) edge_out2 = tf.reduce_mean(tf.stack([edge_out2_100, edge_out2_125, edge_out2_150, edge_out2_175]), axis=0) raw_output = tf.reduce_mean(tf.stack([parsing_out1, parsing_out2]), axis=0) head_output, tail_output = tf.unstack(raw_output, num=2, axis=0) tail_list = tf.unstack(tail_output, num=20, axis=2) tail_list_rev = [None] * 20 for xx in range(14): tail_list_rev[xx] = tail_list[xx] tail_list_rev[14] = tail_list[15] tail_list_rev[15] = tail_list[14] tail_list_rev[16] = tail_list[17] tail_list_rev[17] = tail_list[16] tail_list_rev[18] = tail_list[19] tail_list_rev[19] = tail_list[18] tail_output_rev = tf.stack(tail_list_rev, axis=2) tail_output_rev = tf.reverse(tail_output_rev, tf.stack([1])) raw_output_all = tf.reduce_mean(tf.stack([head_output, tail_output_rev]), axis=0) raw_output_all = tf.expand_dims(raw_output_all, dim=0) pred_scores = tf.reduce_max(raw_output_all, axis=3) raw_output_all = tf.argmax(raw_output_all, axis=3) pred_all = tf.expand_dims(raw_output_all, dim=3) # Create 4-d tensor. raw_edge = tf.reduce_mean(tf.stack([edge_out2]), axis=0) head_output, tail_output = tf.unstack(raw_edge, num=2, axis=0) tail_output_rev = tf.reverse(tail_output, tf.stack([1])) raw_edge_all = tf.reduce_mean(tf.stack([head_output, tail_output_rev]), axis=0) raw_edge_all = tf.expand_dims(raw_edge_all, dim=0) pred_edge = tf.sigmoid(raw_edge_all) res_edge = tf.cast(tf.greater(pred_edge, 0.5), tf.int32) # prepare ground truth preds = tf.reshape(pred_all, [-1,]) gt = tf.reshape(label_batch, [-1,]) weights = tf.cast(tf.less_equal(gt, N_CLASSES - 1), tf.int32) # Ignoring all labels greater than or equal to n_classes. mIoU, update_op_iou = tf.contrib.metrics.streaming_mean_iou(preds, gt, num_classes=N_CLASSES, weights=weights) macc, update_op_acc = tf.contrib.metrics.streaming_accuracy(preds, gt, weights=weights) # # Which variables to load. # restore_var = tf.global_variables() # # Set up tf session and initialize variables. # config = tf.ConfigProto() # config.gpu_options.allow_growth = True # # gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.7) # # config=tf.ConfigProto(gpu_options=gpu_options) # init = tf.global_variables_initializer() # evaluate prosessing parsing_dir = './output' # Set up tf session and initialize variables. config = tf.ConfigProto() config.gpu_options.allow_growth = True ``` 以上是初始化网络和初始化参数载入模型,下面定义两个函数分别处理val1.txt和val2.txt两个列表内部的数据。 ``` # 处理第一个列表函数 def humanParsing1(): # Which variables to load. restore_var = tf.global_variables() init = tf.global_variables_initializer() with tf.Session(config=config) as sess: sess.run(init) sess.run(tf.local_variables_initializer()) # Load weights. loader = tf.train.Saver(var_list=restore_var) if RESTORE_FROM is not None: if load(loader, sess, RESTORE_FROM): print(" [*] Load SUCCESS") else: print(" [!] Load failed...") # Create queue coordinator. coord = tf.train.Coordinator() # Start queue threads. threads = tf.train.start_queue_runners(coord=coord, sess=sess) # Iterate over training steps. for step in range(NUM_STEPS): # parsing_, scores, edge_ = sess.run([pred_all, pred_scores, pred_edge])# , update_op parsing_, scores, edge_ = sess.run([pred_all, pred_scores, pred_edge]) # , update_op print('step {:d}'.format(step)) print(image_list[step]) img_split = image_list[step].split('/') img_id = img_split[-1][:-4] msk = decode_labels(parsing_, num_classes=N_CLASSES) parsing_im = Image.fromarray(msk[0]) parsing_im.save('{}/{}_vis.png'.format(parsing_dir, img_id)) coord.request_stop() coord.join(threads) # 处理第二个列表函数 def humanParsing2(): # Set up tf session and initialize variables. config = tf.ConfigProto() config.gpu_options.allow_growth = True # gpu_options=tf.GPUOptions(per_process_gpu_memory_fraction=0.7) # config=tf.ConfigProto(gpu_options=gpu_options) # Which variables to load. restore_var = tf.global_variables() init = tf.global_variables_initializer() with tf.Session(config=config) as sess: # Create queue coordinator. coord = tf.train.Coordinator() sess.run(init) sess.run(tf.local_variables_initializer()) # Load weights. loader = tf.train.Saver(var_list=restore_var) if RESTORE_FROM is not None: if load(loader, sess, RESTORE_FROM): print(" [*] Load SUCCESS") else: print(" [!] Load failed...") LIST_PATH = './datasets/CIHP/list/val1.txt' DATA_ID_LIST = './datasets/CIHP/list/val_id1.txt' with open(DATA_ID_LIST, 'r') as f: NUM_STEPS = len(f.readlines()) # with tf.name_scope("create_inputs"): with tf.name_scope(scp1): tf.get_variable_scope().reuse_variables() reader = ImageReader(DATA_DIR, LIST_PATH, DATA_ID_LIST, None, False, False, False, coord) image, label, edge_gt = reader.image, reader.label, reader.edge image_rev = tf.reverse(image, tf.stack([1])) image_list = reader.image_list # Start queue threads. threads = tf.train.start_queue_runners(coord=coord, sess=sess) # Load weights. loader = tf.train.Saver(var_list=restore_var) if RESTORE_FROM is not None: if load(loader, sess, RESTORE_FROM): print(" [*] Load SUCCESS") else: print(" [!] Load failed...") # Iterate over training steps. for step in range(NUM_STEPS): # parsing_, scores, edge_ = sess.run([pred_all, pred_scores, pred_edge])# , update_op parsing_, scores, edge_ = sess.run([pred_all, pred_scores, pred_edge]) # , update_op print('step {:d}'.format(step)) print(image_list[step]) img_split = image_list[step].split('/') img_id = img_split[-1][:-4] msk = decode_labels(parsing_, num_classes=N_CLASSES) parsing_im = Image.fromarray(msk[0]) parsing_im.save('{}/{}_vis.png'.format(parsing_dir, img_id)) coord.request_stop() coord.join(threads) if __name__ == '__main__': humanParsing1() humanParsing2() ``` 最终输出结果一直是第一个列表里面的循环,代码上用了 self.queue = tf.train.slice_input_producer([self.images, self.labels, self.edges], shuffle=shuffle),队列的方式进行多线程推理。最终得到的结果一直是第一个列表的循环,求大神告诉问题怎么解决。

关于anaconda安装tensorflow环境配置的问题

之前用anaconda安装过tensorflow失败了,然后我将其删除了。 再安装anaconda与tensorflow时,我发现Anaconda Navigator里并没有tensorflow环境,但我打如下代码却成功运行了。想问问是为什么,以及cmd里的那一行英文提示是什么意思。谢谢 ![图片说明](https://img-ask.csdn.net/upload/201909/05/1567692214_713843.png) ![图片说明](https://img-ask.csdn.net/upload/201909/05/1567692231_475865.png)

magento 1.13重置密码不显示错误消息

<div class="post-text" itemprop="text"> <p>In magento EE 1.13, reset forgot password page not showing any error messages after apply patch 6788.Here is my resetPasswordPostAction() where error messages are adding to session and redirects to changeForgotten action</p> <pre><code>if (!empty($errorMessages)) { $this-&gt;_getSession() -&gt;setCustomerFormData($this-&gt;getRequest()-&gt;getPost()); foreach ($errorMessages as $errorMessage) { $this-&gt;_getSession()-&gt;addError($errorMessage); } $this-&gt;_redirect('*/*/changeforgotten'); return $this; } </code></pre> <p>and in resetforgottenpassword.phtml it showing error messages like </p> <pre><code>&lt;?php echo $this-&gt;getMessagesBlock()-&gt;getGroupedHtml(); ?&gt; </code></pre> <p>core changeForgottenAction is :</p> <pre><code>public function changeForgottenAction() { try { list($customerId, $resetPasswordLinkToken) = $this-&gt;_getRestorePasswordParameters($this-&gt;_getSession()); $this-&gt;_validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken); $this-&gt;loadLayout(); $this-&gt;renderLayout(); } catch (Exception $exception) { $this-&gt;_getSession()-&gt;addError($this-&gt;_getHelper('customer')-&gt;__('Your password reset link has expired.')); $this-&gt;_redirect('*/*/forgotpassword'); } } </code></pre> </div>

centos8编译hpl时 libgoto2_nehalemp-r1.13.a 未在指定位置挂载

我在安装GotoBLAS2的时候显示一切正常,但在编译hpl时却显示未找到libgoto2_nehalemp-r1.13.a,后来看文件,显示未挂载,请问一下这是什么问题?![图片说明](https://img-ask.csdn.net/upload/201912/03/1575340255_958325.png) ![图片说明](https://img-ask.csdn.net/upload/201912/03/1575340268_88832.png) ![图片说明](https://img-ask.csdn.net/upload/201912/03/1575341326_128891.png) 后又发现这个![图片说明](https://img-ask.csdn.net/upload/201912/03/1575341715_605206.png)

tensorflow报错显示在使用后段

使用tensorflow 在idle文件中, 报错使用backend

Go 1.13具有Go Tools版本12.9

<div class="post-text" itemprop="text"> <p>I created the dir <strong>TEST-13</strong> under <strong>GOPATH/src</strong> </p> <p>I installed <strong>hello.go</strong> and <strong>hello_test.go</strong> (the specified test code files)</p> <p>Is there a reason that in version 1.13 running <strong>go mod init</strong> produces the following go.mod:</p> <pre><code>module TEST-13 go 1.12 </code></pre> <p>Running <strong>go tet</strong> in the directory gets errors - See example:</p> <pre><code>compile: version "go1.13" does not match go tool version "go1.12.9" </code></pre> <p>This message produces 7 similar messages for various library modules</p> <p>How do I fix this - or is it a release error? - or did I mess up the install?</p> </div>

mac 下安装 javahl与subclipse版本不吻合问题

mac 下安装 javahl与subclipse版本不吻合需要更新我应该怎么更新希望能给予明细的解答本人 对mac操作不够娴熟

Java 导入.xls文件没问题的但是导入.xlsx文件报异常

求指导 org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13] at org.apache.poi.util.PackageHelper.open(PackageHelper.java:41) at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:190) at com.whgj.common.ExcelSheetParser.<init>(ExcelSheetParser.java:38) at com.whgj.business.home.impl.ImportBusiness.excelToJmjbxx(ImportBusiness.java:49) at com.whgj.web.action.ImportAction.import_excel(ImportAction.java:52) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.poi.openxml4j.exceptions.InvalidFormatException: Package should contain a content type part [M1.13] at org.apache.poi.openxml4j.opc.ZipPackage.getPartsImpl(ZipPackage.java:147) at org.apache.poi.openxml4j.opc.OPCPackage.getParts(OPCPackage.java:596) at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:226) at org.apache.poi.util.PackageHelper.open(PackageHelper.java:39) ... 30 more ![图片说明](https://img-ask.csdn.net/upload/201604/29/1461910670_145195.png) ![图片说明](https://img-ask.csdn.net/upload/201604/29/1461910680_565057.png) 在 workbook = new XSSFWorkbook(is);时发生异常

Goland Debugger无法在Mac上使用Go版本升级(v1.11-> v1.13)

<div class="post-text" itemprop="text"> 我在Mac(Mojave OS)中将golang从v1.11升级到v1.13。 调试器开始出现错误。 <pre><code>API server listening at: 127.0.0.1:xxxxx Version of Delve is too old for this version of Go (maximum supported version 1.12, suppress this error with --check-go-version=false) Debugger finished with exit code 1 </code></pre> <p>从那时起,我一直无法在goland中使用调试器,但是由于cli命令正在起作用,因此进行了深入研究。 但不知道该如何进行? 我也找不到在golang中禁用--check-go-version的任何选项?</p> </div>

通过导入父目录,用golang导入子包?

<div class="post-text" itemprop="text"> <p>I have this main.go file:</p> <pre><code>package main import "one/entities/bar" func main(){ } </code></pre> <p>I have this dir structure:</p> <p><a href="https://i.stack.imgur.com/n2J52.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n2J52.png" alt="enter image description here"></a></p> <p>When I build my project with:</p> <pre><code>go install main </code></pre> <p>I get this compilation error:</p> <blockquote> <p>src/main/main.go:3:8: no Go files in /home/oleg/codes/oresoftware/oredoc/test/builds/go/src/one/entities/bar</p> </blockquote> <p>that error makes sense. Is there some way to import all the subpackages from within the <code>one/entities/bar</code> directory?</p> <p>Something like this:</p> <pre><code>package main import bar "one/entities/bar/*" func main(){ } </code></pre> <p>(using some sort of * syntax and importing all subpackages in the bar namespace).</p> <p><strong>Ultimately I am trying do something like this:</strong></p> <pre><code>package main import ( "log" "one/entities/bar" ) func main(){ v := bar.Get.Basic.Req.Headers{} log.Fatal(v) } </code></pre> </div>

带有golang1.13的go mod tidy无法加载软件包

<div class="post-text" itemprop="text"> <p>When use golang 1.13 with go mod tidy with proxy <a href="https://goproxy.cn" rel="nofollow noreferrer">https://goproxy.cn</a>. I always get the following error:</p> <pre><code>cannot load github.com/astaxie/beego: module github.com/astaxie/beego: Get https://goproxy.cn/github.com/astaxie/beego/@v/list: http: server gave HTTP response to HTTPS client </code></pre> <p>What is the root cause? Configure or else?</p> </div>

如何使Go模块语义导入版本控制v2 +与虚荣导入路径一起使用

<div class="post-text" itemprop="text"> <p>We are trying to migrate our Go code base to go modules and I can't figure out how to make it work with vanity import paths.</p> <hr> <h3>With <code>dep</code></h3> <p>Until now our dependency management tool has been <code>dep</code>. We would place a <code>Gopkg.toml</code> file in our project root, and would define a dependency like:</p> <pre><code>[[constraint]] name = "mycompany.com/some-lib" version = "3.0.0" </code></pre> <p>As you can see, we use a so-called <i>vanity import path</i> for our own packages. In fact, our code is actually hosted on a private git server altogether. <br> So along with this, we set up another server that renders HTML meta tags with repository information. E.g.:</p> <pre><code>&lt;meta name="go-import" content="mycompany.com/some-lib git https://mygitserver.com/some-lib" &gt; </code></pre> <p>The mechanism is basically the one described in cmd/go docs, <a href="https://golang.org/cmd/go/#hdr-Remote_import_paths" rel="nofollow noreferrer">Remote import paths</a>.</p> <hr> <h3>With go modules</h3> <p>So with go modules instead I have <code>export GO111MODULE=on</code> and a <code>go.mod</code> file that requires a dependency according to <a href="https://github.com/golang/go/wiki/Modules#semantic-import-versioning" rel="nofollow noreferrer">semantic import versioning</a>:</p> <pre><code>module foo go 1.13 require ( mycompany.com/some-lib/v3 v3.0.0 ) </code></pre> <p><b>Note</b> that the import path has the <code>v3</code> suffix as required by semantic import versioning. And the <code>some-lib</code> project also has its own <code>go.mod</code> file starting with: <code>module mycompany.com/some-lib/v3</code>.</p> <p>Now my problem is that when <code>go get</code> or <code>go build</code> the dependency resolution fails with:<br> <code>go: mycompany.com/some-lib/v3@v3.0.0: unrecognized import path "mycompany.com/some-lib/v3" (parse https://mycompany.com/some-lib/v3?go-get=1: no go-import meta tags ())</code> <br><br> Of course this happens, because my remote import server handles <code>mycompany.com/some-lib</code> but not <code>mycompany.com/some-lib/v3</code>. </p> <hr> <h3>Question</h3> <ul> <li>Isn't <code>go</code> command able to handle versioned imports automatically? I thought it would query for <code>mycompany.com/some-lib</code> and then fetch <code>v3</code> by itself.</li> <li>Am I supposed to handle every single <code>/vN</code> route in my remote import server? </li> <li>If so, what should I write in the <code>&lt;meta&gt;</code> tag? If not, what should I do?</li> </ul> <p><strong>Bonus info</strong>: I've seen some docs and articles recommending to basically duplicate the code under directories named after major versions, something like:</p> <pre><code>/ ---&gt; contains v1.x.y code |_ main.go |_ interface.go |_ go.mod |_ /v2 ---&gt; contains v2.x.y code |_ main.go |_ interface.go |_ go.mod </code></pre> <p>Or alternatively to maintain separate branches for each major version.<br> I don't want to do this. And I want to <code>require mycompany.com/some-lib/v3 v3.0.0</code> or <code>require mycompany.com/some-lib/v4 v4.1.0</code> based on each client project needs and fetch versions from the same place just as I did with <code>dep</code>.<br><br></p> <p><strong>Bonus info 2:</strong> curiously enough, ALL our project third-party dependencies either are not on go modules or are still on <code>v0</code> or <code>v1</code> versions or just hosted on github, so I can't find applicable examples.<br><br></p> <p>Any insight is extremely appreciated. Thank you.</p> </div>

Idea Mac版想使用Junit,怎么导入jar包

idea 的lib的lib目录下好像有,但idea不能进入.app的包内容

使用go 1.13在Windows下构建一个dll

<div class="post-text" itemprop="text"> <p>I make a simple Go file that exports a function</p> <pre><code>package main import "C" import "fmt" //export PrintBye func PrintBye() { fmt.Println("From DLL: Bye!") } func main() { // Need a main function to make CGO compile package as C shared library } </code></pre> <p>and build it</p> <p>go build -buildmode=c-shared main.go</p> <p>have a problem</p> <blockquote> <h1>command-line-arguments</h1> <p>C:\Program Files\GO\pkg\tool\windows_amd64\link.exe: running gcc failed: exit status 1 C:\Users****\AppData\Local\Temp\go-link-293444627\go.o: file not recognized: file format not recognized collect2.exe: error: ld returned 1 exit status</p> </blockquote> <p>in the MinGW ,I install some basic package</p> <pre><code>mingw-developer-toolkit-bin mingw32-base-bin mingw32-gcc-g++-bin mingw32-gcc-objc-bin msys-base-bin </code></pre> </div>

编译:“ go1.9”版本与go工具“ go1.9.1”版本不匹配

<div class="post-text" itemprop="text"> <p>I am getting this error when I tried to run an example helloworld code I got onlie.</p> <pre><code>compile: version "go1.9" does not match go tool version "go1.9.1" </code></pre> <p>My computer has go1.9.1. What does the error mean and how can I fix this?</p> </div>

如何在 Ubuntu 精确版中安装 Go 的当前版本

<div class="post-text" itemprop="text"> <p>Running <code>sudo apt-get install golang-stable</code>, I get Go version <code>go1.0.3</code>. Is there any way to install <code>go1.1.1</code>?</p> </div> <p>转载于:https://stackoverflow.com/questions/17480044/how-to-install-the-current-version-of-go-in-ubuntu-precise</p>

Java jdk版本不兼容的问题

上次面试的时候 面试官问道的一个问题 好像是一个软件 可以解决 我百度了一下没有找到 求告知!!

无法使用自制软件在Mac上安装go的特定版本

<div class="post-text" itemprop="text"> <p>i am trying to install go lang version 1.12.7 with</p> <pre><code>brew install go@1.12.7 </code></pre> <p>but its saying formula is wrong. Any help would be appreciated.</p> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

win10暴力查看wifi密码

刚才邻居打了个电话说:喂小灰,你家wifi的密码是多少,我怎么连不上了。 我。。。 我也忘了哎,就找到了一个好办法,分享给大家: 第一种情况:已经连接上的wifi,怎么知道密码? 打开:控制面板\网络和 Internet\网络连接 然后右击wifi连接的无线网卡,选择状态 然后像下图一样: 第二种情况:前提是我不知道啊,但是我以前知道密码。 此时可以利用dos命令了 1、利用netsh wlan...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

美团面试,问了ThreadLocal原理,这个回答让我通过了

他想都想不到,ThreadLocal我烂熟于心

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

立即提问
相关内容推荐