Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of TensorFlow and CNN testing method

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "TensorFlow installation and CNN testing method". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

0. Description

After Google opened up the framework, it was tested with a real K40m card. Because the production environment is the operating system of CentOS6.6, but the framework needs to be executed in Python2.7, it was not done under CentOS6.6 for a whole day, and then it was changed to CentOS7, which ran smoothly.

1. System environment

Python > = 2.7

Numpy > = 1.9

Gcc > = 4.8.2

Cuda 7.0

Java > = 1.8

Cudnn 6.5 v2

two。 Installation and deployment

# install dependency, kernel-devel is to install cuda

Yum-y install gcc python-devel kernel-devel

# install pip

Wget-- no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz

Tar zvxf 1.5.5.tar.gz

Cd pip-1.5.5/

Python setup.py install

# install tensorflow, make sure that the server can be connected to the Internet, and download and install numpy and six automatically

Pip install http://dlp.iflytek.com/soft/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

3. Test case CNN

Download training data set

Wget http://dlp.iflytek.com/soft/cifar-10-binary.tar.gz

Tar-zxvf-C / tmp/cifar10_data

Execute script (default cpu)

Cd / root/tensorflow-master/tensorflow/models/image/cifar10

Python cifar10_train.py

Using gpu to execute

Python cifar10_multi_gpu_train.py-num_gpus=4

4. Script related instructions

# View help

Python cifar10_train.py-help

-- batch_size BATCH_SIZE # the number of images in a batch of data. It contains 128examples by default.

Number of images to process in a batch.

-- data_dir DATA_DIR # training dataset directory. Default is / tmp/cifar10_data

Path to the CIFAR-10 data directory.

-- train_dir TRAIN_DIR # training directory

Directory where to write event logs and checkpoint.

-- max_steps MAX_STEPS # maximum number of steps. Default is 1000000.

Number of batches to run.

-- log_device_placement LOG_DEVICE_PLACEMENT

Whether to log device placement.

-- nolog_device_placement

This is the end of the content of "installation of TensorFlow and CNN testing methods". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report