TensorFlow2 Object Detection Api(一)

Anaconda 安装

前往Anaconda官网进行下载。具体安装过程不做详细描述。
官网地址:https://www.anaconda.com/products/individual#Downloads

新建虚拟环境

conda create -n tensorflow pip python=3.8

在windows下如果显示’conda’ 不是内部或外部命令,检查环境配置问题,或者直接打开Anaconda Prompt输入上面的命令。

进入新建的虚拟环境

conda activate tensorflow

安装TensorFlow2

pip install --ignore-installed --upgrade tensorflow==2.4.1

国内下载速度太慢可以切换镜像
清华镜像:https://pypi.tuna.tsinghua.edu.cn/simple some-package

安装Jupyter notebook(非必要)

conda install jupyter

检测安装结果

python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2021-02-02 14:10:59.821079: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-02-02 14:10:59.846798: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
2021-02-02 14:11:02.208266: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
2021-02-02 14:11:02.209552: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
2021-02-02 14:11:02.209830: W tensorflow/stream_executor/cuda/cuda_driver.cc:326] failed call to cuInit: UNKNOWN ERROR (303)
2021-02-02 14:11:02.215073: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: DESKTOP-HSHJA7U
2021-02-02 14:11:02.215310: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: DESKTOP-HSHJA7U
2021-02-02 14:11:02.216268: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-02-02 14:11:02.216604: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
tf.Tensor(263.02908, shape=(), dtype=float32)

Gpu加速部分后面更新

下载TensorFlow Model Garden

地址:https://github.com/tensorflow/models

自带教程运行

  1. 启动jupyter notebok
  2. 打开models/research/object_detection/colab_tutorials/object_detection_tutorial.ipynb文件

至此基本环境配置完成,但是有个小问题,在object_detection_tutorial.ipynb中他会重新下载一个新的model文件夹放在object_detection中,但这个文件夹和上面提到的ModelGarden是相同的文件。所以我们也可以将object_detection_tutorial.ipynb中的配置命令自己配置一遍。后面将继续介绍如何使用自己的数据。

阅读终点,创作起航,您可以撰写心得或摘录文章要点写篇博文。去创作
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

吃瓜小白鼠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值