unofficial-implement-of-openpose项目源码
- 配置C与python API接口。mac安装siwg
原项目中的Reademe中给出以下安装方法:
$ sudo apt install swig
但在终端运行时给出以下提示:
解决方法:尝试使用hombrew安装
- 中科大镜像安装安装Homebrew
/bin/zsh -c “$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”
安装完成后终端运行
brew install swig
输入swig -version验证是否安装正确
- pafprocess module which is written in c++
cd到pafprocess文件夹下
swig -python -c++ pafprocess.i
python3 setup.py build_ext --inplace
3.代码基于TensorFlow1.x版本,TensorFlow2.x版本存在缺少的属性
报错:
AttributeError: module ‘tensorflow‘ has no attribute ‘disable_v2_behavior‘
AttributeError: module 'tensorflow_core.compat.v1' has no attribute 'contrib'
- 解决方法:将 TensorFlow 1.X 的代码转换为 TensorFlow 2.0
tf_upgrade_v2 --infile D:\tensorflowProject\tf01.py --outfile D:\tensorflowProject\tf01_upgraded.py
转化后的代码替换之前的代码即可。
在python3.8安装tensroflow1.14版本的方法
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl