caffe训练预训练模型_Caffe2-验证对预训练模型的访问

caffe训练预训练模型

caffe训练预训练模型

Caffe2-验证对预训练模型的访问 (Caffe2 - Verifying Access to Pre-Trained Models)

Before you learn to use a pre-trained model in your Python application, let us first verify that the models are installed on your machine and are accessible through the Python code.

在学习在Python应用程序中使用经过预先训练的模型之前,让我们首先验证模型已安装在您的计算机上并可以通过Python代码访问。

When you install Caffe2, the pre-trained models are copied in the installation folder. On the machine with Anaconda installation, these models are available in the following folder.

当您安装Caffe2时,将预先训练的模型复制到安装文件夹中。 在安装了Anaconda的机器上,这些模型在以下文件夹中可用。


anaconda3/lib/python3.7/site-packages/caffe2/python/models

Check out the installation folder on your machine for the presence of these models. You can try loading these models from the installation folder with the following short Python script −

请检查计算机上的安装文件夹是否存在这些型号。 您可以尝试使用以下简短的Python脚本从安装文件夹中加载这些模型-


CAFFE_MODELS = os.path.expanduser("/anaconda3/lib/python3.7/site-packages/caffe2/python/models")
INIT_NET = os.path.join(CAFFE_MODELS, 'squeezenet', 'init_net.pb')
PREDICT_NET = os.path.join(CAFFE_MODELS, 'squeezenet', 'predict_net.pb')
print(INIT_NET)
print(PREDICT_NET)

When the script runs successfully, you will see the following output −

脚本成功运行后,您将看到以下输出-


/anaconda3/lib/python3.7/site-packages/caffe2/python/models/squeezenet/init_net.pb
/anaconda3/lib/python3.7/site-packages/caffe2/python/models/squeezenet/predict_net.pb

This confirms that the squeezenet module is installed on your machine and is accessible to your code.

这确认squeezenet模块已安装在您的计算机上,并且代码可访问。

Now, you are ready to write your own Python code for image classification using Caffe2 squeezenet pre-trained module.

现在,您准备使用Caffe2 squeezenet预训练模块编写自己的Python代码以进行图像分类。

翻译自: https://www.tutorialspoint.com/caffe2/caffe2_verifying_access_pre_trained_models.htm

caffe训练预训练模型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值