Chinese Truman
  • 首页
  • 归档
  • 分类
  • 标签
  • 关于

pytorch中tensor进行reshape操作后原始数据的顺序

在pytorch中,经常需要对tensor进行reshape操作,使其符合特定网络的输入格式。在将网络的输 出重新reshape回输入前的形状时,tensor的特征是否还是按输入的顺序进行排列? 带着疑问做了下面的实验 1234567891011121314x1 = torch.randn(2, 3)x2 = torch.randn(2, 3)x3 = torch.randn(2, 3)x4 =
2021-11-19
pytorch
#python #pytorch

python列表解析实例

if起条件判断作用,满足条件的,返回最终生成的列表1[i for i in range(k) if condition] 12345[i for i in range(10) if i%2 == 0]output:[0, 2, 4, 6, 8] if…else用来判断或赋值,满足条件的i以及j生成最终的列表1[i if condition else j for exp] 123456[i i
2021-10-28
python
#python

不使用anaconda安装pyembree

pyembree官方给出的安装方法是通过conda进行安装 1conda install -c conda-forge pyembree 并没有pip的版本,想要安装pyembree就得先装anaconda,在docker里有点不方便。 在github上查到可以通过.tar.gz文件进行手动安装 首先将embree.bash中的内容保存到本地文件e.bash里,之后在命令行执行 1bash e.
2021-09-26
linux
#linux #docker

Spherical Package编译记录

最近要用到Spherical-Package,这个包有两种安装方法,一种是通过Docker安装,另一种是直接手动安装。但是服务器上网不方便,所以一开始先手动装。 手动装的问题基本上都是没有root权限、安装版本不匹配、依赖错误等。最后经过一番折腾装好了,但是测试的时候还是失败,也找不到问题出在哪里。猜测可能是手动装的cgal有问题,因为通过apt-get安装的cgal版本太低,所以只能手动装,但是
2021-09-12
linux
#linux #docker #包安装

Dockerfile基础镜像选择

Dockerfile的最开始都是From xxx,表示选择的基础镜像是什么版本,可以在nvidia的gitlab上选择版本。需要注意nvidia/cuda:latest的表示方式已经被弃用,可以看前面写的文章 例如 1FROM nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 其中10.0是指cuda的版本 cudnn7指与cuda10.0对应的cudnn版本
2021-09-11
linux
#linux #docker

Depends: gcc-5-base (= 5.3.1-14ubuntu2) but 5.4.0-6ubuntu1~16.04.11 is to be installed

在5.4.0-6ubuntu1~16.04.11 : cpp-5 : amd64 : Xenial (16.04) : Ubuntu上下载对应的版本,国内源的版本都是5.4.0-6ubuntu1~16.04.12,最后一位是12,和服务器上的不匹配
2021-09-11
c++
#linux #c++

Dockerfile安装python3.7

用Dockerfile构造镜像时需要用到python3.7,但是python默认安装的版本是3.5。需要手动安装python3.7 安装的主要代码如下: 123456wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgztar -xvf Python-3.7.3.tgzcd Python-3.7.3./configure --en
2021-09-11
python
#linux #docker #python

Dockerfile pip3 install cannot assign requested address

临时使用国内镜像可解决 1pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider 参考https://www.cnblogs.com/developer-ios/p/7628733.html
2021-09-10
docker
#docker

Dockerfile unable to access ‘.git/‘: Failed to connect to gitlab.com

问题在命令行手动build一个dockerfile时无法连接到git。 Dockerfile中的系统和本地的不同,适用于本地的配置直接在Dockerfile中使用无效 12git config --global http.proxy 'http://172.31.xx.xx:808'git config --global https.proxy 'https://17
2021-09-10
linux
#linux #docker

Error response from daemon: manifest for nvidia/cuda:latest not found: manifest unknown: manifest

原因 The “latest” tag for CUDA, CUDAGL, and OPENGL images has been deprecated on NGC and Docker Hub Docker Hub中的CUDA, CUDAGL和OPENGL镜像已经弃用”latest“标签,直接使用 1docker pull nvidia/cuda 或者在Dockerfile中指定 1FROM
2021-09-09
linux
#linux
1…678910

搜索

© 2022-2026 Real Supervised Chinese Truman
总访问量 次 总访客数 人