MLWIC:Python的R问题中的野生动物图像分类的机器学习
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了MLWIC:Python的R问题中的野生动物图像分类的机器学习,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含5194字,纯文字阅读大概需要8分钟。
内容图文
![MLWIC:Python的R问题中的野生动物图像分类的机器学习](/upload/InfoBanner/zyjiaocheng/670/980e7c621f68444b9c66a86ad5c23dfa.jpg)
我是一位野生动物博士研究人员,以人工方式识别约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:按照说明在以下位置安装“ pip”,python和“ TensorFlow”
https://www.tensorflow.org/install/pip
3:下载了L1文件夹
4:我运行的代码与自述文件中概述的代码不同,如下所示:
setup(python_loc =“我使用了在Anaconda中运行“ where python”获得的位置”)
完成此初始设置后,我运行了“分类功能”的代码:
图书馆(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时似乎设置了错误,这与我的编码方式有关吗?
解决方法:
如果我没记错的话,他们的代码中有一个小错误,它会忽略“ data_info”路径.尝试将“ image_labels.csv”重命名为“ data_info.csv”,然后将文件放在model_dir中.这为我解决了问题.另外,使用“ C:/ ProgramData / Anaconda3 /”代替“ C:/ProgramData/Anaconda3/python.exe”
内容总结
以上是互联网集市为您收集整理的MLWIC:Python的R问题中的野生动物图像分类的机器学习全部内容,希望文章能够帮你解决MLWIC:Python的R问题中的野生动物图像分类的机器学习所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。