我是一名野生动物博士研究员,按物种手动识别约 150 万张游戏相机照片。R 中的机器学习包最近来自一个研究项目,我一直试图让脚本在 R 中运行大约 12 个小时,但似乎无法正确完成(我经常使用 R 和 python ,但我不是专家,这是我在这里提出的第一个问题,如果我没有正确执行此操作,请原谅我)。
在 Github 上下载的软件包的自述文件(要了解我想要做什么,您可能必须阅读此内容,我深表歉意)位于:https://github.com/mikeyEcology/MLWIC/blob/master/README。 MD
对我来说不幸的是,该软件包是在 Macintosh 平台上开发的,而我有 Windows。我按照自述文件中的步骤如下:
1:使用代码安装MLWIC包:
devtools::install_github("mikeyEcology/MLWIC")
library(MLWIC)
2:按照https://www.tensorflow.org/install/pip上的说明安装“pip”、python 和“TensorFlow”
3:下载L1文件夹
4:我运行的代码与自述文件中概述的代码不同,如下所示: setup(python_loc = "I used this location I used from running "where python" in Anaconda")
在这个初始设置之后,我运行了“分类函数”的代码:library(MLWIC)
setup(python_loc = "C:/ProgramData/Anaconda3", conda_loc = "auto", r_reticulate = FALSE)
setwd("C:/Users/werdel/Desktop/MachineLearning")
help("classify")
classify(path_prefix = "C:/Users/werdel/Desktop/MachineLearning/images",# this is the absolute path to the images.
data_info = "C:/Users/werdel/Desktop/MachineLearning/image_labels.csv", # this is the location of the csv containing image information. It has Unix linebreaks and no headers.
model_dir = "C:/Users/werdel/Desktop/MachineLearning", # assuming this is where you stored the L1 folder in Step 3 of the instructions: github.com/mikeyEcology/MLWIC/blob/master/README
python_loc = "C:/ProgramData/Anaconda3/python.exe", # the location of Python on your computer.
save_predictions = "model_predictions.txt" # this is the default and you should use it unless you have reason otherwise.)
这就是问题似乎出现的地方。它似乎运行良好,输出显示在我的工作目录中创建的文件,但是当我检查时,没有文件。我尝试更改 python 位置,下载新旧版本的 anaconda,弄乱环境,但没有任何改变我的工作目录中没有创建文件的事实:
> library(MLWIC)
> setup(python_loc = "C:/ProgramData/Anaconda3", conda_loc = "auto", r_reticulate = FALSE)
Remove all packages in environment C:\PROGRA~3\ANACON~1\envs\r-reticulate:
## Package Plan ##
environment location: C:\PROGRA~3\ANACON~1\envs\r-reticulate
The following packages will be REMOVED:
ca-certificates: 2018.03.07-0
certifi: 2018.10.15-py37_0
openssl: 1.1.1a-he774522_0
pip: 18.1-py37_0
python: 3.7.1-he44a216_5
setuptools: 40.6.2-py37_0
vc: 14.1-h0510ff6_4
vs2015_runtime: 14.15.26706-h3a45250_0
wheel: 0.32.3-py37_0
wincertstore: 0.2-py37_0
Solving environment: ...working... done
## Package Plan ##
environment location: C:\PROGRA~3\ANACON~1\envs\r-reticulate
added / updated specs:
- python
The following NEW packages will be INSTALLED:
ca-certificates: 2018.03.07-0
certifi: 2018.10.15-py37_0
openssl: 1.1.1a-he774522_0
pip: 18.1-py37_0
python: 3.7.1-he44a216_5
setuptools: 40.6.2-py37_0
vc: 14.1-h0510ff6_4
vs2015_runtime: 14.15.26706-h3a45250_0
wheel: 0.32.3-py37_0
wincertstore: 0.2-py37_0
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use:
# > activate r-reticulate
#
# To deactivate an active environment, use:
# > deactivate
#
# * for power-users using bash, you must source
#
Solving environment: ...working... failed
UnsatisfiableError: The following specifications were found to be in conflict:
- argparse
- tensorflow
Use "conda info <package>" to see the dependencies for each package.
Error: Error 1 occurred installing packages into conda environment r-reticulate
> classify(path_prefix = "C:/Users/werdel/Desktop/MachineLearning/images", # this is
the absolute path to the images.
+ data_info = "C:/Users/werdel/Desktop/MachineLearning/image_labels.csv", #
this is the location of the csv containing image information. It has Unix linebreaks
and no headers.
+ model_dir = "C:/Users/werdel/Desktop/MachineLearning", # assuming this is
where you stored the L1 folder in Step 3 of the instructions:
github.com/mikeyEcology/MLWIC/blob/master/README
+ python_loc = "C:/ProgramData/Anaconda3/python.exe", # the location of Python
on your computer.
+ save_predictions = "model_predictions.txt" # this is the default and you
should use it unless you have reason otherwise.
+ )
[1] "evaluation of images took 0.000504970550537109 secs. The results are stored in
C:/Users/werdel/Desktop/MachineLearning/L1/model_predictions.txt. To view the results
in a viewer-friendly format, please use the function make_output"
所以我的最后一个问题是,在下载 pip、tensorflow、anaconda 和 python 时,我是否设置了一些错误,是否与我的编码方式等有关?