pycaffe

PyInstaller “ValueError: too many values to unpack”

喜夏-厌秋 提交于 2021-02-18 10:28:25
问题 Pyinstaller version 3.2 OS: win10 My python script work well in Winpython Python Interpreters. But when I using Pyinstaller packages a python script include caffe module, I will face the problem: “You may load I/O plugins with the skimage.io.use_plugin” I follow the answer above to fix my spec file(hook file??). And I have been getting following error: (ValueError: too many values to unpack) Traceback (most recent call last): File "d:\python\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib

How to modify the Imagenet Caffe Model?

|▌冷眼眸甩不掉的悲伤 提交于 2020-06-22 08:12:25
问题 I would like to modify the ImageNet caffe model as described bellow: As the input channel number for temporal nets is different from that of spatial nets (20 vs. 3), we average the ImageNet model filters of first layer across the channel, and then copy the average results 20 times as the initialization of temporal nets. My question is how can I achive the above results? How can I open the caffe model to be able to do those changes to it? I read the net surgery tutorial but it doesn't cover

VGG 16/19 Slow Runtimes

偶尔善良 提交于 2020-01-14 05:58:09
问题 When I try to get an output from the pre-trained VGG 16/19 models using Caffe with Python (both 2.7 and 3.5) it's taking over 15 seconds on the net.forward() step (on my laptop's CPU). I was wondering if anyone might advise me as to why this could be, as with many other models (i.e. ResNet, AlexNet) I get an output in a split second, this is the only model I've found so far that's performing this poorly. The code I'm using is as follows: img = cv2.imread(path + img_name + '.jpg') img =

windows SSD caffe

亡梦爱人 提交于 2020-01-07 05:26:49
问题 everyone,when I test ssd_pascal_video.py in windows,I got the following error: E:\caffe-ssd-microsoft\Build\x64\Release\pycaffe>python E:\caffe-ssd-microsoft\examples\ssd\ssd_pascal_webcam.py --cpu Traceback (most recent call last): File "E:\caffe-ssd-microsoft\examples\ssd\ssd_pascal_webcam.py", line 151, in <module> for file in os.listdir(snapshot_dir): WindowsError: [Error 3] : 'models/VGGNet/VOC0712/SSD_300x300/*.*' then,I check the ssd_pascal_video.py,I find the following code,I can't

Caffe net.forward call for multiple batches

拜拜、爱过 提交于 2020-01-05 07:18:05
问题 I am using ImageData type of data in .prototxt file and trying to get the features from python code using net.forward() and net.blobs of caffe library. However, I get only 50 features after net.forward() call which is the batch_size which I have set in .prototxt file. How can I get the features for subsequent batches? Do I have to call net.forward() multiple times? 来源: https://stackoverflow.com/questions/48520103/caffe-net-forward-call-for-multiple-batches

Forward from the first of lmdb when using net.forward in pycaffe

吃可爱长大的小学妹 提交于 2020-01-05 05:36:08
问题 I am using pycaffe and my train and test data is in LMDB format. I have created my net like this: net = caffe.Net('train.prototxt', 'c.caffemodel', caffe.TEST) when you call net.forward, implicitly you walk through the LMDB test database one by one batches. My question is how can I start from the beginning of LMDB and test my network on the first n batches of the test data? Thanks 回答1: not sure it still relevant but you would need to change the data of input layer ,something like this net

Win7 64位 + Cuda8.0 + CuDNN_v5.1 + VS2013 + Caffe安装笔记

心已入冬 提交于 2020-01-04 16:40:20
总体步骤: 1. 安装显卡驱动 2. 安装CUDA8.0 3. 安装CuDNN_v5.1 4. 安装Caffe 5. Caffe example测试 详细步骤: 1. 安装显卡驱动 1.1 查看显卡型号。 右键计算机->设备管理器->显示适配器 1.2 下载对应型号的最新显卡驱动。 地址: http://www.nvidia.cn/Download/index.aspx?lang=cn 1.3 双击.exe文件安装 2. 安装CUDA8.0 2.1 登录官网下载CUDA8.0 地址: https://developer.nvidia.com/cuda-toolkit 2.2 双击.exe文件安装 2.3 验证CUDA8.0已正确安装 2.3.1 打开cmd,输入nvcc -V。结果如下图。 2.3.2 编译CUDA8.0自带的samples 在C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0目录下,用vs2013,打开Samples_vs2013.sln,在Release下,选中解决方案Samples_vs2013,重新生成解决方案。第一次编译的时候,会提示找不到”d3dx9.h”、”d3dx10.h”、”d3dx11.h”头文件,可从 这里 下载DXSDK_Jun10.exe,按照默认安装。(安装时可能出现错误S1023

Caffe model gives same output for every image

心不动则不痛 提交于 2020-01-04 02:30:38
问题 I just loaded alexnet in caffe using predefined prototxt and caffemodel files. However sending any image to the model returns the same value as output of fc7 layer. Here is the code snippet net=caffe.Net('alexnet/train_val.prototxt','alexnet/bvlc_alexnet.caffemodel',caffe.TEST) for image in images: im = np.array(caffe.io.load_image(image)) im = caffe.io.resize_image(im, (227, 227)) im = np.array(im,dtype=np.float32) im =255*im; im = im[:,:,::-1] im -= np.array(((104.00698793,116.66876762,122

pycaffe生成solver文件并运行

谁说我不能喝 提交于 2020-01-03 11:08:38
使用pycaffe生成solver文件 # 如何利用pycaffe 生成 solver 文件 from caffe.proto import caffe_pb2 s = caffe_pb2.SolverParameter() # 封装了 solver文件的类 # 定义solver文件的参数 s.train_net = "train.prototxt" # 要训练的网络 s.test_net.append('test.prototxt') # 定义测试网络 s.test_interval = 100 # 训练多长时间测试一次 s.test_iter.append(10) # 测试迭代数, # 例如:有10000个测试样本,batch_size设为32, # 那么就需要迭代 10000/32=313次才完整地测试完一次,所以设置test_iter为313。 s.max_iter = 1000 # 最大迭代次数 s.base_lr = 0.1 # 基础学习率 s.weight_decay = 5e-4 # 定义学习率 衰减率 s.lr_policy = 'step' # 定义学习率更新的方式 s.display = 10 # 定义打印网络的间隔 s.snapshot = 10 # 定义 caffemodel 存储的间隔 s.snapshot_prefix = 'model' #

net surgery on a custom caffe model

心已入冬 提交于 2020-01-03 00:57:10
问题 I'm trying to modify the weights of a caffemodel which is part of a caffe-branch called Deep Lab. Although there is a tutorial on how to do net surgery, when I try to do the same with my custom caffemodel the python kernel dies always on the following line: # Load the original network and extract the fully connected layers' parameters. net = caffe.Net('../models/deeplab/train.prototxt', '../models/deeplab/train.caffemodel', caffe.TRAIN) I think its because pycaffe doesn't know their custom