libtorch读取数组(读取内存) at::Tensor tensor = torch::from_blob(array, Height * Width * Chanels, torch::TensorOptions().dtype(torch::kInt32)).clone();
undefined reference to `google::protobuf::internal::VerifyVersion(int, int, char const*)‘ 错误解决方法 解决方法:在工程CMakeLists.txt中添加find_package(Protobuf REQUIRED)include_directories(${PROTOBUF_INCLUDE_DIR})target_link_libraries(main student ${PROTOBUF_LIBRARY})
ubuntu18.04安装远程桌面 方法:利用xrdp1.下载以及安装。wget http://www.c-nergy.be/downloads/install-xrdp-3.0.zipunzip install-xrdp-3.0.zipchmod +x Install-xrdp-3.0.sh./Install-xrdp-3.0.sh2.然后输入账户密码,等待安装结束安装结束后可能还会出现闪退现象,此时:echo gnome-session > ~/.xsession3.所有工作完成。参考链接:ubuntu18
c++ 对结构体分级排序 对于结构体分级排序,例如:typedef struct Point{ int x; int y; float z; int index;}Point;现在要将vector<Point>数据按照x从小到大,y从小到大,z从大到小排序。解决方法:利用运算符重载。typedef struct Point{ int x; int y; float z; int index; bool operator < (const Point &b){ if(x !=
linux clock函数 由于之前踩坑,发现clock计时不准确。特意记录一下程序计时方法。结论:程序计时使用c++ 11的chrono,不要使用clock。原文链接:c++异步处理和clock函数踩坑1. 异步处理异步处理,在本文,只是为了多线程加速程序运行速度。异步处理一般需要有如下步骤,1.1 确认或者封装需要异步处理的函数这个过程可以理解为,将一个运行速度慢,需要加速的部分,拆解为很多小模块,每个小模块自身比较快。那么,在每个线程中,只运行这个小块,多个线程同时工作的时候,总体的时间就会比较少。1.2 调用异
c++ lambda函数 c++ lambda函数能够提升性能,减少函数开销例子如下:#include <iostream>#include <time.h>using namespace std;#define N 10000000void test(){ for(int i = 0; i < N; i++){}}int main(){ clock_t start, end; start = clock(); test(); end =
ubuntu开机启动程序 supervisor 1.安装supervisorsudo apt-get updatesudo apt-get install supervisor2.建立启动项目cd /etc/supervisor/conf.dsudo vim pwm.conf3.所有启动项目都是一个xxx.conf的文件,例如我的pwm程序如下:[program:pwm]command = /home/wsy/install/pwm_setautostart = true此处,我需要开机执行的命令是/home/wsy/insta
python open3d报错 DeprecationWarning: `np.float` is a deprecated 根据警告原因,发现是sklearn导致。解决方法:更新sklearnpip install --upgrade scikit-learn问题解决
opencv c++配置测试 操作系统:ubuntu20.04版本:opencv4.xCMakeLists.txtcmake_minimum_required(VERSION 3.0 FATAL_ERROR)project(main)find_package(OpenCV REQUIRED)include_directories(${OpenCV_INCLUDE_DIRS})message("OpenCV include: " ${OpenCV_INCLUDE_DIRS})link_directories(${OpenC