千家信息网

大数据中常用框架的测试方法有哪些

发表于:2025-12-01 作者:千家信息网编辑
千家信息网最后更新 2025年12月01日,这篇文章主要介绍了大数据中常用框架的测试方法有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。1.方法1.0:TensorFlowT
千家信息网最后更新 2025年12月01日大数据中常用框架的测试方法有哪些

这篇文章主要介绍了大数据中常用框架的测试方法有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

1.方法

1.0:TensorFlow

TensorFlow1.x与TensorFlow2.x测试方法是一样的,代码如下:

import tensorflow as tfprint(tf.test.is_gpu_available())

上述代码保存为.py文件,使用需要测试环境即可运行,输出:上面是一下log信息,关键的是的最后True,表示测试成功

2020-09-28 15:43:03.197710: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX22020-09-28 15:43:03.204525: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library nvcuda.dll2020-09-28 15:43:03.232432: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties:name: GeForce RTX 2070 with Max-Q Design major: 7 minor: 5 memoryClockRate(GHz): 1.125pciBusID: 0000:01:00.02020-09-28 15:43:03.235352: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_100.dll2020-09-28 15:43:03.242823: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll2020-09-28 15:43:03.261932: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cufft64_100.dll2020-09-28 15:43:03.268757: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library curand64_100.dll2020-09-28 15:43:03.297478: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusolver64_100.dll2020-09-28 15:43:03.315410: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cusparse64_100.dll2020-09-28 15:43:03.330562: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll2020-09-28 15:43:03.332846: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1746] Adding visible gpu devices: 02020-09-28 15:43:05.198465: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix:2020-09-28 15:43:05.200423: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165]      02020-09-28 15:43:05.201540: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0:   N2020-09-28 15:43:05.203863: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1304] Created TensorFlow device (/device:GPU:0 with 6306 MB memory) -> physical GPU (device: 0, name: GeForce RTX 2070 with Max-Q Design, pci bus id: 0000:01:00.0, compute capability: 7.5)True

上面是一下log信息,关键的是的最后True,表示测试成功。其实我们还可以发现很多GPU信息

GPU型号:name: GeForce RTX 2070 with Max-Q Design

cuda版本:Successfully opened dynamic library cudart64_100.dll(10.0)

cudnn版本:Successfully opened dynamic library cudnn64_7.dll(7.x)

GPU数目:Adding visible gpu devices: 0(1)

GPU显存:/device:GPU:0 with 6306 MB memory(8G)

1.1:PyTorch

PyTorch与TensorFlow测试方法类似,都有GPU测试接口。PyTorch的GPU测试代码如下:

import torchprint(torch.cuda.is_available())

上述代码保存为.py文件,使用需要测试环境即可运行,输出:True,表示测试成功

True

可以看出PyTorch输出信息简洁很多。其实TensorFlow的log信息输出也是可以控制的。

1.2:MXNet

MXNet与PyTorch,TensorFlow测试方法不同,由于MXNet'没有GPU测试接口(或者说笔者没有找到)。所以MXNet的GPU测试代码采用try-catch捕捉异常的方法来测试,代码如下:

import mxnet as mxmxgpu_ok = Falsetry:    _ = mx.nd.array(1,ctx=mx.gpu(0))    mxgpu_ok = Trueexcept:    mxgpu_ok = Falseprint(mxgpu_ok)

上述代码保存为.py文件,使用需要测试环境即可运行,输出:True,表示测试成功

1.3:PaddlePaddle

PaddlePaddle与TensorFlow测试方法类似,都有GPU测试接口。PyTorch的GPU测试代码如下:

import paddlepaddle.fluid.install_check.run_check()

上述代码保存为.py文件,使用需要测试环境即可运行,输出:Your Paddle Fluid works well on MUTIPLE GPU or CPU.,表示测试成功

Running Verify Fluid Program ...W0928 16:23:17.825171 10572 device_context.cc:252] Please NOTE: device: 0, CUDA Capability: 75, Driver API Version: 11.0, Runtime API Version: 10.0W0928 16:23:17.836141 10572 device_context.cc:260] device: 0, cuDNN Version: 7.6.Your Paddle Fluid works well on SINGLE GPU or CPU.W0928 16:23:19.349067 10572 build_strategy.cc:170] fusion_group is not enabled for Windows/MacOS now, and only effective when running with CUDA GPU.Your Paddle Fluid works well on MUTIPLE GPU or CPU.Your Paddle Fluid is installed successfully! Let's start deep Learning with Paddle Fluid now

感谢你能够认真阅读完这篇文章,希望小编分享的"大数据中常用框架的测试方法有哪些"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!

测试 代码 方法 输出 成功 信息 文件 环境 篇文章 运行 接口 常用 数据 框架 关键 是的 版本 不同 简洁 价值 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 新推出的企业网络安全解决方案 新疆新科达软件开发有限公司招聘 数据库客户端软件开发 网络安全信息等级证书 教师网络技术培训总结500字 阿里服务器安全组怎么删除 广西交通网络安全直播课 网络安全现状与未来发展趋势 阴阳师国际服怎么看服务器 网络安全论文致谢老师 数据库排序和内存排序哪个快 数据库建库建表 编办网络安全责任承诺书 帮我播放一下网络安全手抄报 软件工程 网络软件开发 个人软件开发收入税金计算 福建海纳百川网络技术 网络技术对测绘的帮助 明日之后有秋日森林这个服务器吗 计算机网络技术树立目标 政务大厅网络安全自查情况报告 数据库文本角标 三级网络技术考试如何抽题 中山大搜索软件开发有限公司 阜阳求职招聘软件开发公司 软件开发付费条款 咨询网络技术服务好处 文明重启玩家服务器选择 主题搜藏数据库 守望先锋怎么老是掉服务器
0