当前位置:网站首页>开源深度学习框架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模块加速效果对比
边栏推荐
- Demand and business model analysis-1-business model canvas
- Leetcode topic [string]-344- reverse string
- 3D object detection
- Is it really hopeless to choose electronic engineering and be discouraged?
- VC Hacon Joint Programming genimage3extern writeimage
- [digital ic/fpga] data accumulation output
- Wechat e-book reading applet graduation design works (1) development outline
- First build green, then build city
- 运算器的基本结构
- 进程会计、进程时间、守护进程
猜你喜欢

Detailed explanation of yolox network structure

mysql的增删改查,mysql常用命令

运算器的基本结构

【观察】华为下一代数据中心,为广西低碳高质量发展“添动能”

硬件测试之—纹波测试为什么不要使用接地夹子

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 搭建 LVGL 的开发调试环境

Promise to solve hell function calls can be used infinitely

YOLOX网络结构详解

攻防世界(web篇)---supersqli
随机推荐
[5gc] Introduction to three SSC (session and service continuity) modes
Market scale forecast and future competitive trend outlook report of China's plastic and cosmetic industry 2022-2028
New product launch
Php+flash large file breakpoint continuation function sharing
API call display, detailed API of Taobao, tmall and pinduoduo commodity pages, and return of APP side original data parameters
Negative remainder problem
DACOM G150 dual-mode earphones make sound for love and protect the healthy growth of children's hearing
系统 日志
设备管理-借还模块界面代码
Transactions in redis
Leetcodesql: count the number of students in each major
基于微信电子书阅读小程序毕业设计毕设作品(6)开题答辩PPT
在 Traefik Proxy 2.5 中使用/开发私有插件(Traefik 官方博客)
ISCC2022
Blue Bridge Cup basic-14 VIP question time conversion
What are the third-party software testing organizations in Shanghai that share knowledge about software validation testing?
How does Eldon's ring of the law get lune quickly? Introduction to the fastest and safest method for obtaining lune
Fault analysis | a case of MySQL remote slave database replication delay
BannerViewPager
王学岗room+paging3
https://github.com/plaidml/plaidml