当前位置:网站首页>开源深度学习框架PlaidML安装及测试
开源深度学习框架PlaidML安装及测试
2022-06-12 19:36:00 【欧晨eli】
开源链接:
PlaidML 致力于跨平台开发部署的开源高性能深度学习框架,目前PlaidML支持Keras,OpenCL,Linux,macOS和Windows的支持。最重要的是PlaidML 可以使用AMD的显卡在windows平台上进行深度学习,由于手头上的笔记本只有A卡,所以决定尝试一下利用A卡的GPU来尝试一下,虽然是基于Opencl的加速,尝试一下和CUDA的对比。
1安装PlaidML
1.1安装python
在windows平台上安装PlaidML还是比较简单的,按照官网的例子,其实不需要安装Chocolatey这个软件,只需要安装python 和vcredist2015就可以了,还有显卡的驱动需要安装,支持OpenCL 1.2版本以上。
1.2安装PlaidML-keras
这需要安装PlaidML版本的keras,PlaidML-keras最新的版本是0.7,但是最新的版本安装的时候有问题,具体参照GitHub上的issue,所以最好是指定版本安装
pip install plaidml-keras==0.6.4
1.3运行PlaidML-setup

2测试运行
GitHub上的Hello VGG例子
import numpy as np
import os
import time
os.environ["KERAS_BACKEND"] = "plaidml.keras.backend"
import keras
import keras.applications as kapp
from keras.datasets import cifar10
(x_train, y_train_cats), (x_test, y_test_cats) = cifar10.load_data()
batch_size = 8
x_train = x_train[:batch_size]
x_train = np.repeat(np.repeat(x_train, 7, axis=1), 7, axis=2)
model = kapp.VGG16()
model.compile(optimizer='sgd', loss='categorical_crossentropy',
metrics=['accuracy'])
print("Running initial batch (compiling tile program)")
y = model.predict(x=x_train, batch_size=batch_size)
# Now start the clock and run 10 batches
print("Timing inference...")
start = time.time()
for i in range(10):
y = model.predict(x=x_train, batch_size=batch_size)
print("Ran in {} seconds".format(time.time() - start))
这里采用的是keras的标准接口,直接导入keras的模型和predict的功能,一下为运行的结果
GPU的使用情况
3测试结果
加载Opencl的速度还是挺快的,比tensorflow加载CUDA的速度要快,可能是我的笔记本电脑的显存比较少,只有2G,运行的结果可以看到batch_size为8,运行10次,标准的VGG16输入的大小为224x224X3,predictde1时间大约为0.26秒。
4待测试项目
- PlaidML 的CPU加速
- 和Tensorflow的对比
- 和OpenCV的DNN模块加速效果对比
边栏推荐
- Add, delete, modify and query mysql, common MySQL commands
- Mysql database experiment I data definition
- 今晚7:00 | PhD Debate 自监督学习在推荐系统中的应用
- The component style set by uniapp takes effect in H5 and app, but does not take effect in wechat applet. The problem is solved
- RT thread simulator builds lvgl development and debugging environment
- Attack and defense world (WEB) -- supersqli
- 原生Servlet - 文件的Upload&Download
- 5G R17标准冻结,主要讲了些啥?
- ISCC2022
- Standard library template learning introduction original
猜你喜欢

Shell 编程正则表达式及元字符

system()
![[generation confrontation network learning III] reading notes of Bigan paper and its principle understanding](/img/6b/0f0815e20cdf6da28793562bcaede1.png)
[generation confrontation network learning III] reading notes of Bigan paper and its principle understanding

Attack and defense world (WEB) -- supersqli

WinCC7.5 SP1调整画面尺寸以适应显示分辨率的方法

“即服务”,未来已来,始于现在 | IT消费新模式,FOD按需计费

Equipment management - borrowing and returning module 1

Implementation of VGA protocol based on FPGA

Add, delete, modify and query mysql, common MySQL commands

Embedded development: 6 necessary skills for firmware engineers
随机推荐
基于微信电子书阅读小程序毕业设计毕设作品(7)中期检查报告
Shell programming regular expressions and metacharacters
Business opportunities with an annual increase of 3billion - non cage eggs or a new blue ocean for export to ASEAN
What are meta-inf and WEB-INF respectively?
In 2021, the global fire pump drive power revenue is about $381million, and it is expected to reach $489.3 million in 2028
Php+flash large file breakpoint continuation function sharing
Shell 编程正则表达式及元字符
基於分布式數據庫本身的定時備份方法
Analysis report on market demand and investment strategy of China's re guarantee industry 2022-2028
asp. Net using JSON to interact with API data
负数取余问题
94. 解析网页中的内容
模塊八作業
Detailed explanation of IO flow basic knowledge -- file and IO flow principle
Mysql database experiment I data definition
Cookie & Session & kaptcha验证码
RT thread simulator builds lvgl development and debugging environment
Negative remainder problem
The component style set by uniapp takes effect in H5 and app, but does not take effect in wechat applet. The problem is solved
[observation] Huawei's next generation data center "adds momentum" to Guangxi's low-carbon and high-quality development
https://github.com/plaidml/plaidml