logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

Pytorch | Pytorch框架中模型和数据的gpu和cpu模式:model.to(device), model.cuda(), model.cpu(), DataParallel

背景介绍我们在使用Pytorch训练时,模型和数据有可能加载在不同的设备上(gpu和cpu),在算梯度或者loss的时候,报错信息类似如下:RuntimeError: Function AddBackward0 returned an invalid gradient at index 1 - expected type torch.cuda.FloatTensor but got torch.F

#pytorch
LeetCode | 129. Sum Root to Leaf Numbers

题目:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find t

Tensorflow | 常用 API 之 FLAGS —— tf.app.flags

题外话:最近读开源的tensorflow程序代码,发现了好用的flag,感觉有必要学习一下。在程序之中我们通常都会用到很多参数变量、常量、或者标志量来辅助程序的流程。例如,在规定神经网络的输入中,我们需要规定输入的尺寸width、height等等;我们也可以通过定义is_training标志量来判断当前流程是训练阶段还是测试阶段。Tensorflow中的tf.app.flags可以...

LeetCode | 445. Add Two Numbers II

题目You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a single digit. Add the two numbers and retur

#算法#leetcode
Package | 解决 ImportError: libGL.so.1: cannot open shared object file: No such file or directory

.背景在本机/docker环境里经常遇到这个报错,每次都先找解决方案。因为近期遇到这个报错太频繁,还是决定记录一下。.问题运行程序,出现报错信息如下:ImportError: libGL.so.1: cannot open shared object file: No such file or directory从字面上理解,环境钟缺少libGL.so.1文件,即缺少GL库文件。搜索得到libGL

Package | 解决 module ‘cv2‘ has no attribute ‘gapi_wip_gst_GStreamerPipeline‘

由于这个问题出现了两回,决定记录一下。实验背景是使用opencv python库进行数据预处理,遇到报错信息如下:“import cv2”

#python#opencv#开发语言
Package | 解决 Could not build wheels for opencv-python which use PEP 517 and cannot be installed

背景在nvidia ngc平台下载docker image,根据实验要求在环境里安装opencv。因为当前实验tensorflow要求版本较低,我下载了比较久远的版本镜像。如果大家是自己复现代码,还是使用尽可能新的环境,则可以避免大部分环境问题。问题通过pip安装opencv,指令如下:pip install opencv-python安装过程的输出:Collecting opencv-pytho

#python#opencv#pip
Package | 解决 Could not build wheels for opencv-python which use PEP 517 and cannot be installed

背景在nvidia ngc平台下载docker image,根据实验要求在环境里安装opencv。因为当前实验tensorflow要求版本较低,我下载了比较久远的版本镜像。如果大家是自己复现代码,还是使用尽可能新的环境,则可以避免大部分环境问题。问题通过pip安装opencv,指令如下:pip install opencv-python安装过程的输出:Collecting opencv-pytho

#python#opencv#pip
Package | 解决 Could not build wheels for opencv-python which use PEP 517 and cannot be installed

背景在nvidia ngc平台下载docker image,根据实验要求在环境里安装opencv。因为当前实验tensorflow要求版本较低,我下载了比较久远的版本镜像。如果大家是自己复现代码,还是使用尽可能新的环境,则可以避免大部分环境问题。问题通过pip安装opencv,指令如下:pip install opencv-python安装过程的输出:Collecting opencv-pytho

#python#opencv
Package | 解决 Windows10 Anaconda环境 CUDA11.5 pytorch运行报错 No CUDA runtime is found

.背景在windows下使用anaconda管理多个环境(尤其用于模型训练),已成为算法工程师的一种基本技能。平时大部分时间都在用linux+docker,我也趁着这次的环境调试好好学习了一下anaconda的环境创建和管理。整体来说,anaconda的使用还是非常人性化的,具体官网请转至 all you need know about anaconda..环境配置如标题所示,实验的系统环境是wi

#pytorch#深度学习#python
暂无文章信息