当前位置:网站首页>Installation and testing of open source deep learning framework plaidml
Installation and testing of open source deep learning framework plaidml
2022-06-12 19:43:00 【Ouchen Eli】
Open source links :
PlaidML Open source high performance dedicated to cross platform development and deployment Deep learning frame , at present PlaidML Support Keras,OpenCL,Linux,macOS and Windows Support for . most important of all PlaidML have access to AMD Your graphics card is windows Deep learning on the platform , Because the notebook on hand is only A card , So I decided to try to use A Card GPU Let's try , Although it is based on Opencl The acceleration of , Try and CUDA Comparison of .
1 install PlaidML
1.1 install python
stay windows On the platform PlaidML It's a little bit easier , According to the example on the official website , There's no need to install Chocolatey This software , Just install python and vcredist2015 That's all right. , And the driver of the graphics card needs to be installed , Support OpenCL 1.2 Above version .
1.2 install PlaidML-keras
This requires installation PlaidML Version of keras,PlaidML-keras The latest version is 0.7, But there was a problem installing the latest version , Specific reference to GitHub Upper issue, So it's best to specify the version to install
pip install plaidml-keras==0.6.4
1.3 function PlaidML-setup

2 test run
GitHub Upper Hello VGG Example
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))
What we use here is keras Standard interface for , Direct import keras The model and predict The function of , The following is the result of the run 
GPU Usage situation 
3 test result
load Opencl The speed of is still very fast , Than tensorflow load CUDA It's faster , Maybe my laptop has less video memory , Only 2G, The results of the operation can be seen batch_size by 8, function 10 Time , The standard VGG16 The size entered is 224x224X3,predictde1 The time is about 0.26 second .
4 Items to be tested
- PlaidML Of CPU Speed up
- and Tensorflow Comparison of
- and OpenCV Of DNN Module acceleration effect comparison
边栏推荐
- Demand and business model innovation-4-strategy
- asp. Net using JSON to interact with API data
- 【splishsplash】自定义导出器
- QT -- how to get the contents of selected cells in qtableview
- vc hacon 联合编程 GenImage3Extern WriteImage
- Méthode de sauvegarde programmée basée sur la base de données distribuée elle - même
- Microsoft Word 教程,如何在 Word 中插入页眉或页脚?
- WinCC7.5 SP1调整画面尺寸以适应显示分辨率的方法
- PostgreSQL database replication - background first-class citizen process walreceiver PG_ stat_ wal_ Receiver view
- 设备管理-借还模块1
猜你喜欢

leetcodeSQL:602. Friend application II: who has the most friends

什么是数据驱动

Reading small program graduation design based on wechat e-book (5) assignment

Unsupported class file major version 60

DACOM G150 dual-mode earphones make sound for love and protect the healthy growth of children's hearing

How does Eldon's ring of the law get lune quickly? Introduction to the fastest and safest method for obtaining lune

VC hacon joint programming genimage3extern writeimage

7:00 tonight | application of PhD debate self supervised learning in Recommendation System

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

3GPP RAN第一次F2F会议,都干了些啥?
随机推荐
Microsoft Word 教程,如何在 Word 中插入页码、目录?
3GPP RAN第一次F2F会议,都干了些啥?
基于分布式数据库本身的定时备份方法
负数取余问题
Shell arrays and functions
"As a service", the future has come, starting from the present | new mode of it consumption, FOD billing on demand
基于微信电子书阅读小程序毕业设计毕设作品(8)毕业设计论文模板
Demand and business model innovation - demand 2- demand basis
VC Hacon Joint Programming genimage3extern writeimage
How do I create my own appender in log4j- How to create my own Appender in log4j?
Shell 编程正则表达式及元字符
Demand and business model innovation-5-process
Global and Chinese smart government industry market research and investment risk outlook report 2022-2028
Simple understanding of anti shake function
Is it really hopeless to choose electronic engineering and be discouraged?
mysql的增删改查,mysql常用命令
7:00 tonight | application of PhD debate self supervised learning in Recommendation System
Promise to solve hell function calls can be used infinitely
Wangxuegang room+paging3
Shell 数组和函数
https://github.com/plaidml/plaidml