
学习路上的坑
HelloWor1d丶
这个作者很懒,什么都没留下…
展开
-
从源码安装人脸Dlib库报错。cuda_dlib.cu(1762): error
从GitHub上下载源码Dlib库进行安装时,报如下错误:[ 1%] Building NVCC (Device) object dlib/CMakeFiles/dlib.dir/cuda/dlib_generated_cuda_dlib.cu.o/home/zjb/dlib/dlib/cuda/cuda_dlib.cu(1762): error: calling a constexpr __host__ function("log1p") from a __device__ function(".原创 2020-06-06 14:25:17 · 1099 阅读 · 0 评论 -
QObject::moveToThread: Current thread is not the object`s thread. Cannot move to target thread
报错:Opencv无法显示图像,报错QObject::moveToThread: Current thread is not the object's thread . Cannot move to target thread解决方案:conda install pyqt,完美解决。PS:因为这个报错信息比较模糊不够具体,所以无法定位问题的根源在哪。在网上寻找了各种解决方法,基本上都是如下的方法,但是我是在实验室的服务器上,没有sudo权限,没法apt-get,因此下面这种方案并没有亲自尝试,这里贴出原创 2020-06-06 14:22:38 · 23222 阅读 · 28 评论 -
keras和tf.keras的坑。ValueError: Output of generator should be a tuple (x, y, sample_weight) or (x, y)
问题:用keras可以正常使用,而使用tf.keras时,(版本keras=2.2.4, tf=1.14),会报如下错误:ValueError: Output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: [array...分析:看报错信息大概可以分析出,是generator_output这的问题,大概是我们自己数据增强后,生成的数据有问题。那为什么keras可以正常使用,而tf.keras就不能呢。原创 2020-06-06 14:17:34 · 2094 阅读 · 0 评论 -
undefined symbol: __cudaPopCallConfiguration
报错:undefined symbol: __cudaPopCallConfiguration原因:cuda的版本和pytorch的cuda版本不一致。解决方案:重新安装pytorch。版本对应关系 https://pytorch.org/get-started/previous-versions/示例如下:conda install pytorch=0.4.1 torchvision cuda92 -c pytorch...原创 2020-06-06 14:11:22 · 948 阅读 · 1 评论 -
fatal error: cuda_runtime.h: No such file or directory
程序报错:cuda_runtime.h: No such file or directory原因:cuda路径未设置或设置错误。解决方案:在~/.bashrc文件中加入你的cuda路径;然后重新激活环境source .bashrc(这一步不要忘记)。示例如下:export PATH=${HOME}/cuda/cuda-9.2/bin:$PATHexport LD_LIBRARY_PATH=${HOME}/cuda/cuda-9.2/lib64:$LD_LIBRARY_PATH...原创 2020-06-06 14:10:01 · 5650 阅读 · 1 评论 -
AttributeError: `NoneType` object has no attribute `_inbound_nodes`
操作:原本想在网络中对输入图像tensor进行裁剪,直接用了x = x[:, 0:h2, w1:w3].报错:Keras AttributeError: 'NoneType' object has no attribute '_inbound_nodes'原因:Keras搭建的网络中要用层来表示的,不能直接用Tensor或是Numpy。解决方案:利用Lambda封装成一个Layer。示例如下:slice_input = Lambda(lambda x: x[:, 0:h2, w1:w3])(img原创 2020-06-06 14:06:18 · 1050 阅读 · 0 评论 -
ValueError: Output tensors to a Model must be the output of a TensorFlow `Layer`
操作:想对keras网络最后输出的tensor进行截取,模型中直接写了代码out2 = out[:, :, :, -4:].报错:ValueError: Output tensors to a Model must be the output of a TensorFlow 'Layer'原因:Keras搭建的网络中要用层来表示的,不能直接用Tensor或是Numpy。解决方案:利用Lambda封装成一个Layer。示例如下:# out2 = out[:, :, :, -4:]# 如果直接用上述原创 2020-06-06 14:00:24 · 1465 阅读 · 0 评论