对于pointnet配置相关bug的解决

2024-04-19 07:38

本文主要是介绍对于pointnet配置相关bug的解决,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Pointnet参考链接

Pointnet和Pointnet++的pytorch版源码链接参考
https://github.com/yanx27/Pointnet_Pointnet2_pytorch

visualizer文件部分问题解决

1、win10系统下build.sh文件运行问题

安装git–>安装g++
安装git:https://so.csdn.net/so/search?q=%E5%AE%89%E8%A3%85git&t=&u=
安装g++: http://c.biancheng.net/view/8077.html
git运行linux脚本
可通过linux系统或者已安装的git中bash环境运行build.sh脚本
安装完毕g++之后可通过sh build.sh运行,见上图

2、win10系统下download_data.sh文件运行问题

该文件位于链接https://github.com/KuangenZhang/ldgcnn的part_seg的文件夹下
download_data bug
对于sh download_data运行问题的错误,主要原因为Issued certificate has expired,win10系统下解决方案为:通过记事本打开sh文件,wget指令后添加–no-check-certificate
若显示无–no-check-certificate参数,参考https://blog.csdn.net/topsogn/article/details/121217646?spm=1001.2014.3001.5501

def download():BASE_DIR = os.path.dirname(os.path.abspath(__file__))DATA_DIR = os.path.join(BASE_DIR, 'data')if not os.path.exists(DATA_DIR):os.mkdir(DATA_DIR)if not os.path.exists(os.path.join(DATA_DIR, 'modelnet40_ply_hdf5_2048')):www = 'https://shapenet.cs.stanford.edu/media/modelnet40_ply_hdf5_2048.zip'zipfile = os.path.basename(www)os.system('wget --no-check-certificate %s' % (www))os.system('unzip %s' % (zipfile))os.system('mv %s %s' % (zipfile[:-4], DATA_DIR))os.system('rm %s' % (zipfile))

若显示unzip不是内部或外部命令,也不是可运行的程序或批处理文件。则可通过在系统环境变量中添加windows下的zip.exe和unzip.exe的路径

3、 raise OSError(“no file with expected extension”)问题

在运行PointNet的可视化程序时,作者只提供了linux平台下的动态链接库程序源码,自己的windows平台下无法调用。发现是动态链接库的文件格式不对,遂学习如何将.so文件转换成.dll文件

3.1 安装viusal studio
3.2 新建C++动态链接库项目

创建dll动态链接库新项目

3.3 修改头文件pch.h
#ifndef PCH_H
#define PCH_H// 添加要在此处预编译的标头
#include "framework.h"#endif //PCH_H
//定义宏
#ifdef IMPORT_DLL
#else
#define IMPORT_DLL extern "C" _declspec(dllimport) //指的是允许将其给外部调用
#endif// 改为你所需要的链接库函数
IMPORT_DLL void render_ball(int h, int w, unsigned char* show, int n, int* xyzs, float* c0, float* c1, float* c2, int r);

修改头文件pch.h

3.4 重写dllmain.cpp文件
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "pch.h"
#include <cstdio>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;struct PointInfo {int x, y, z;float r, g, b;
};
void render_ball(int h, int w, unsigned char* show, int n, int* xyzs, float* c0, float* c1, float* c2, int r) {r = max(r, 1);vector<int> depth(h * w, -2100000000);vector<PointInfo> pattern;for (int dx = -r; dx <= r; dx++)for (int dy = -r; dy <= r; dy++)if (dx * dx + dy * dy < r * r) {double dz = sqrt(double(r * r - dx * dx - dy * dy));PointInfo pinfo;pinfo.x = dx;pinfo.y = dy;pinfo.z = dz;pinfo.r = dz / r;pinfo.g = dz / r;pinfo.b = dz / r;pattern.push_back(pinfo);}double zmin = 0, zmax = 0;for (int i = 0; i < n; i++) {if (i == 0) {zmin = xyzs[i * 3 + 2] - r;zmax = xyzs[i * 3 + 2] + r;}else {zmin = min(zmin, double(xyzs[i * 3 + 2] - r));zmax = max(zmax, double(xyzs[i * 3 + 2] + r));}}for (int i = 0; i < n; i++) {int x = xyzs[i * 3 + 0], y = xyzs[i * 3 + 1], z = xyzs[i * 3 + 2];for (int j = 0; j<int(pattern.size()); j++) {int x2 = x + pattern[j].x;int y2 = y + pattern[j].y;int z2 = z + pattern[j].z;if (!(x2 < 0 || x2 >= h || y2 < 0 || y2 >= w) && depth[x2 * w + y2] < z2) {depth[x2 * w + y2] = z2;double intensity = min(1.0, (z2 - zmin) / (zmax - zmin) * 0.7 + 0.3);show[(x2 * w + y2) * 3 + 0] = pattern[j].b * c2[i] * intensity;show[(x2 * w + y2) * 3 + 1] = pattern[j].g * c0[i] * intensity;show[(x2 * w + y2) * 3 + 2] = pattern[j].r * c1[i] * intensity;}}}
}
// 具体内容改为你的文件内容

重写主函数
转载链接:https://blog.csdn.net/Moringstarluc/article/details/105702543

注: 若pycharm调试时出现OSError: [WinError 193] %1 不是有效的 Win32 应用程序 的问题

bug解决2
原因为visual调试时的 配置: Debug Win32,需修改为Win64,解决方案见下图,修改为x64即可
修改调试版本

这篇关于对于pointnet配置相关bug的解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/916939

相关文章

IDEA编译报错“java: 常量字符串过长”的原因及解决方法

《IDEA编译报错“java:常量字符串过长”的原因及解决方法》今天在开发过程中,由于尝试将一个文件的Base64字符串设置为常量,结果导致IDEA编译的时候出现了如下报错java:常量字符串过长,... 目录一、问题描述二、问题原因2.1 理论角度2.2 源码角度三、解决方案解决方案①:StringBui

mybatis和mybatis-plus设置值为null不起作用问题及解决

《mybatis和mybatis-plus设置值为null不起作用问题及解决》Mybatis-Plus的FieldStrategy主要用于控制新增、更新和查询时对空值的处理策略,通过配置不同的策略类型... 目录MyBATis-plusFieldStrategy作用FieldStrategy类型每种策略的作

Python Jupyter Notebook导包报错问题及解决

《PythonJupyterNotebook导包报错问题及解决》在conda环境中安装包后,JupyterNotebook导入时出现ImportError,可能是由于包版本不对应或版本太高,解决方... 目录问题解决方法重新安装Jupyter NoteBook 更改Kernel总结问题在conda上安装了

Goland debug失效详细解决步骤(合集)

《Golanddebug失效详细解决步骤(合集)》今天用Goland开发时,打断点,以debug方式运行,发现程序并没有断住,程序跳过了断点,直接运行结束,网上搜寻了大量文章,最后得以解决,特此在这... 目录Bug:Goland debug失效详细解决步骤【合集】情况一:Go或Goland架构不对情况二:

解决jupyterLab打开后出现Config option `template_path`not recognized by `ExporterCollapsibleHeadings`问题

《解决jupyterLab打开后出现Configoption`template_path`notrecognizedby`ExporterCollapsibleHeadings`问题》在Ju... 目录jupyterLab打开后出现“templandroidate_path”相关问题这是 tensorflo

如何解决Pycharm编辑内容时有光标的问题

《如何解决Pycharm编辑内容时有光标的问题》文章介绍了如何在PyCharm中配置VimEmulator插件,包括检查插件是否已安装、下载插件以及安装IdeaVim插件的步骤... 目录Pycharm编辑内容时有光标1.如果Vim Emulator前面有对勾2.www.chinasem.cn如果tools工

Java多线程父线程向子线程传值问题及解决

《Java多线程父线程向子线程传值问题及解决》文章总结了5种解决父子之间数据传递困扰的解决方案,包括ThreadLocal+TaskDecorator、UserUtils、CustomTaskDeco... 目录1 背景2 ThreadLocal+TaskDecorator3 RequestContextH

SpringBoot+MyBatis-Flex配置ProxySQL的实现步骤

《SpringBoot+MyBatis-Flex配置ProxySQL的实现步骤》本文主要介绍了SpringBoot+MyBatis-Flex配置ProxySQL的实现步骤,文中通过示例代码介绍的非常详... 目录 目标 步骤 1:确保 ProxySQL 和 mysql 主从同步已正确配置ProxySQL 的

解决JavaWeb-file.isDirectory()遇到的坑问题

《解决JavaWeb-file.isDirectory()遇到的坑问题》JavaWeb开发中,使用`file.isDirectory()`判断路径是否为文件夹时,需要特别注意:该方法只能判断已存在的文... 目录Jahttp://www.chinasem.cnvaWeb-file.isDirectory()遇

Spring Boot整合log4j2日志配置的详细教程

《SpringBoot整合log4j2日志配置的详细教程》:本文主要介绍SpringBoot项目中整合Log4j2日志框架的步骤和配置,包括常用日志框架的比较、配置参数介绍、Log4j2配置详解... 目录前言一、常用日志框架二、配置参数介绍1. 日志级别2. 输出形式3. 日志格式3.1 PatternL