
python库
学习视觉记录
这个作者很懒,什么都没留下…
展开
-
caffe2线程泄露 torch1.9 独有warning & docker 容器exit code
参考于https://blog.youkuaiyun.com/qq_41963227/article/details/119391566记录一下!!caffe2线程泄露问题描述:在使用pytorch1.9的dataloader时,如果设置num_workers>0或者pin_memory=True时,出现caffe2线程泄露的warning,数量等于num_workers的数量。[W pthreadpool-cpp.cc:90] Warning: Leaking Caffe2 thread-pool原创 2021-12-24 17:23:44 · 1091 阅读 · 0 评论 -
docker环境 下安装minkowskiengine 和open3d
最近用到了Minkowskiengine, 实验版本0.4.3~·个人觉得是最简单的编译方式了,make命令不需要在docker下安装,特此记录1 首先pull镜像, anyway 基于个人实践经验ubuntu18.04比 20.04友好。FROM nvidia/cuda:10.2-cudnn8-devel-ubuntu18.04RUN apt-get update RUN apt-get install -y software-properties-common镜像构建完毕,这里关于镜像创原创 2021-12-15 13:15:49 · 2278 阅读 · 0 评论 -
loss.backward()报错runtime error: one of the variables needed for gradient computation
1 这是因为 在计算梯度前此变量被修改。解决办法“(1)把激活函数的 inplace= True 全部改为falsetorch.relu(inplace =False)(2) 赋值符 += => +a+=b # 修改为a =a+ b原创 2021-12-14 17:15:38 · 2386 阅读 · 0 评论 -
docker下open3d安装记录
1 理论上 pip install open3d就行了,但是是在docker下安装很多依赖都是没有的,pip install 后import 会报错,如:…while loading shared libraries: libc++.so.1 cann… 特此记录需要安装依赖:apt-get updateapt-get install libc++1然后缺什么包就再安装什么就ok ,如plyfile。pip3 install plyfile...原创 2021-12-10 11:51:34 · 1297 阅读 · 0 评论 -
open3d获取点云法向量,并指定方向
官方文档:官方文档一 获取点云:open3d支持ply等形式直接读取就可o3d.io.read_point_cloud,但是不支持.bin文件所以可以numpy读取bin文件再转换成open3d的数据格式转换的代码:points = np.random.uniform(-1, 1, (10000, 3))pointcloud = o3d.geometry.PointCloud()pointcloud.points = o3d.utility.Vector3dVector(points)原创 2021-12-09 12:27:29 · 3269 阅读 · 0 评论 -
import cv2的 问题,,docker中遇到,ImportError: libGL.so.1: cannot open shared object file: No such file or d
import cv2的 问题,,docker中遇到,pip install opencv-pytorch 可以,但是 import的时候报错缺少安装依赖:apt install libgl1-mesa-glx执行:实现不行的话就素有的依赖都安装一遍,!!2 或者 在 dockerfile里面加上RUN apt-get update RUN apt-get install ffmpeg libsm6 libxext6 -yRUN apt-get install -y python3-原创 2021-11-17 14:49:21 · 772 阅读 · 0 评论 -
RuntimeError: CUDA error: device-side assert triggered CUDA kernel
报错:RuntimeError: CUDA error: device-side assert triggered CUDA kernel看起来是 runtimeerror,指向性很模糊,其实是 index溢出的问题,比如你的loss_list,data,或者什么数组的 取值超出范围了,特此记录,找了一天。。。。哈!...原创 2021-11-17 13:30:59 · 660 阅读 · 0 评论 -
Diceloss
pytorch中的 Diceloss 记录https://github.com/BloodAxe/pytorch-toolbelt/blob/0.4.1/pytorch_toolbelt/losses/dice.py输入:y_pred: NxCxHxW y_true: NxHxWfrom typing import Listimport torchimport torch.nn.functional as Ffrom pytorch_toolbelt.utils.torch原创 2021-11-14 20:59:40 · 1062 阅读 · 0 评论 -
python安装hydra
1.安装记录安装的pypi名字不是Hydra 而是 如下 特此记录pip install hydra-core然后等待就可以啦原创 2021-11-11 23:06:57 · 11095 阅读 · 3 评论 -
python的argparse,logging
学习用到了,在此记录,可选参数,必选参数,action = 'store_true’设置True/False参考手册~import argparseparser = argparse.ArgumentParser()parser.add_argument("square", help="display a square of a given number",type=int) # 必选的parser.add_argument("--batch", help="display a squa.原创 2021-10-11 20:57:34 · 294 阅读 · 1 评论 -
torch_scatter安装步骤
查看自己的torch和cuda或者cpu版本import torchtorch.__version__版本一定需要正确匹配2 ## pip或者conda直接安装不可以自行下载手动安装官网:https://pytorch-geometric.com/whl/https://pytorch-geometric.com/whl/torch-1.9.0%2Bcu111.html3 pip install .whl文件搞定!...原创 2021-10-04 22:59:12 · 5268 阅读 · 1 评论