小编mrg*_*oom的帖子

Conda:目标环境中缺少以下包

我正在尝试卸载 awscli:

conda list | grep aws
awscli                    1.18.78                  pypi_0    pypi

(base) % conda remove awscli
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are missing from the target environment:
  - awscli
Run Code Online (Sandbox Code Playgroud)

但由于某种原因conda找不到包。卸载 awscli 的正确方法是什么?

python pip anaconda conda aws-cli

11
推荐指数
1
解决办法
6991
查看次数

是否可以在不重新编译程序的情况下在BLAS库之间切换?

例如,我可以同时在我的Ubuntu 14.04上安装Atlas,OpenBlas,MKL并在它们之间切换而无需重新编译Caffe吗?

c++ linux blas openblas caffe

10
推荐指数
3
解决办法
1756
查看次数

conda安装降级python版本

我试图降级anaconda的python版本conda install python=3.3,但有以下错误:

~/anaconda3/bin$ ./conda install python=3.3
Fetching package metadata .........
Solving package specifications: .


UnsatisfiableError: The following specifications were found to be in conflict:
  - gevent -> python 2.6*
  - python 3.3*
Use "conda info <package>" to see the dependencies for each package.
Run Code Online (Sandbox Code Playgroud)

如何解决与包的冲突?

python anaconda conda

10
推荐指数
4
解决办法
3万
查看次数

关于 keras.utils.Sequence 的说明

Keras关于keras.utils.Sequence 的信息很少,实际上我想从中派生批处理生成器的唯一原因keras.utils.Sequence是我不想自己编写带有队列的线程池,但我不确定它是否是最佳选择我的任务,这是我的问题:

  1. __len__如果我有随机生成器并且我没有任何带有样本的预定义“列表”,应该返回什么。
  2. keras.utils.Sequence 应该如何与 一起使用fit_generator,我主要对max_queue_size, workers, use_multiprocessing,shuffle 参数感兴趣 。
  3. keras 中还有哪些其他可用选项?

python multithreading multiprocessing deep-learning keras

10
推荐指数
1
解决办法
4380
查看次数

可以在Keras模型中使用tf.contrib.quantize.create_training_graph吗?

是否可以将tf.contrib.quantize.create_training_graph已训练的Keras模型用于模型量化?

据我了解,我可以tf.Graph从Keras模型导入,但是我可以在用修改后对其进行微调tf.contrib.quantize.create_training_graph吗?

我能够tf.contrib.quantize.create_training_graph(input_graph=K.get_session().graph, quant_delay=int(0))在模型定义和模型加载之后调用,但是得到:

2019-02-22 14:56:24.216742: W tensorflow/c/c_api.cc:686] Operation '{name:'global_average_pooling2d_1_1/Mean' id:3777 op device:{} def:{global_average_pooling2d_1_1/Mean = Mean[T=DT_FLOAT, Tidx=DT_INT32, keep_dims=false](conv2d_15_1/act_quant/FakeQuantWithMinMaxVars:0, global_average_pooling2d_1_1/Mean/reduction_indices)}}' was changed by updating input tensor after it was run by a session. This mutation will have no effect, and will trigger an error in the future. Either don't modify nodes after running them or create a new session.
Run Code Online (Sandbox Code Playgroud)

转换为keras-> tensorflow-> tflite时,至少我能够使用uint8权重保存模型,因为我了解到模型和推理的输入仍然是fp32。

converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(
        graph_def_file='tf_model.pb',
        input_arrays=input_node_names,
        output_arrays=output_node_names)

converter.post_training_quantize = True

tflite_model = …
Run Code Online (Sandbox Code Playgroud)

quantization deep-learning keras tensorflow

10
推荐指数
0
解决办法
528
查看次数

OpenCV - SURF特征比较

我很好奇如何OpenCV比较功能描述符.例如,我可以使用cvExtractSURF()获取功能列表及其64位(或128位)描述符,在哪里可以找到如何比较两个描述符?

在逐步介绍一些示例代码时,对我来说,看起来我的两个"匹配"特征具有非常不同的描述符(至少通过数值).

有没有人想出如何采取两个描述符数组并进行比较?

谷歌搜索没有太多帮助......

干杯,布雷特

c++ graphics opencv objective-c computer-vision

9
推荐指数
2
解决办法
8363
查看次数

无法用pip安装pycurl

无法使用pip,win xp x32,python 2.7安装pycurl.

这是日志

pip install pycurl
Downloading/unpacking pycurl
  Downloading pycurl-7.19.3.1.tar.gz (116Kb): 116Kb downloaded
  Running setup.py egg_info for package pycurl
    Please specify --curl-dir=/path/to/built/libcurl
    Complete output from command python setup.py egg_info:
    Please specify --curl-dir=/path/to/built/libcurl

----------------------------------------
Command python setup.py egg_info failed with error code 10 in C:\Documents and S
ettings\User\build\pycurl
Storing complete log in C:\Documents and Settings\User\Application Data\pip\pi
p.log
Run Code Online (Sandbox Code Playgroud)

python installation pip pycurl

9
推荐指数
5
解决办法
2万
查看次数

如何获得python脚本的峰值内存使用?

我正在做一些广泛的科学python计算,并想知道python脚本的执行时间和内存占用.

那么如何获得python脚本的峰值内存使用?

如果重要的话我在Windows上使用python 2.7.

python memory out-of-memory scientific-computing

9
推荐指数
2
解决办法
1914
查看次数

了解 tf.contrib.lite.TFLiteConverter 量化参数

我正在尝试使用 UINT8 量化,同时将 tensorflow 模型转换为 tflite 模型:

如果使用post_training_quantize = True,模型大小比原始 fp32 模型低 x4,所以我假设模型权重是 uint8,但是当我加载模型并通过interpreter_aligner.get_input_details()[0]['dtype']它的 float32获取输入类型时。量化模型的输出与原始模型大致相同。

converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(
        graph_def_file='tflite-models/tf_model.pb',
        input_arrays=input_node_names,
        output_arrays=output_node_names)
converter.post_training_quantize = True
tflite_model = converter.convert()
Run Code Online (Sandbox Code Playgroud)

转换模型的输入/输出:

print(interpreter_aligner.get_input_details())
print(interpreter_aligner.get_output_details())
[{'name': 'input_1_1', 'index': 47, 'shape': array([  1, 128, 128,   3], dtype=int32), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0)}]
[{'name': 'global_average_pooling2d_1_1/Mean', 'index': 45, 'shape': array([  1, 156], dtype=int32), 'dtype': <class 'numpy.float32'>, 'quantization': (0.0, 0)}]
Run Code Online (Sandbox Code Playgroud)

另一种选择是明确指定更多参数:模型大小比原始 fp32 模型低 x4,模型输入类型为 uint8,但模型输出更像是垃圾。

converter = tf.contrib.lite.TFLiteConverter.from_frozen_graph(
        graph_def_file='tflite-models/tf_model.pb',
        input_arrays=input_node_names,
        output_arrays=output_node_names)
converter.post_training_quantize = True …
Run Code Online (Sandbox Code Playgroud)

python quantization deep-learning tensorflow tensorflow-lite

9
推荐指数
2
解决办法
6341
查看次数

torch.cuda.device_count() 返回 0

我已经通过以下方式在 virtualenv 下安装了 pytorch:

pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1.post2-cp35-cp35m-linux_x86_64.whl
pip3 install torchvision
Run Code Online (Sandbox Code Playgroud)

但出于某种原因:

import torch
torch.cuda.device_count()
0
torch.cuda.is_available()
False
Run Code Online (Sandbox Code Playgroud)

看起来 pytorch 出于某种原因检测到了 cuda 9:

torch._C._cuda_getDriverVersion()
9010
Run Code Online (Sandbox Code Playgroud)

我的系统:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial


nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Fri_Feb__8_19:08:17_PST_2019
Cuda compilation tools, release 10.1, V10.1.105


Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux


ls -l /usr/local/ …
Run Code Online (Sandbox Code Playgroud)

python pip ubuntu-16.04 pytorch

9
推荐指数
1
解决办法
3360
查看次数