Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello #68

Open
chang556 opened this issue Oct 3, 2022 · 1 comment
Open

hello #68

chang556 opened this issue Oct 3, 2022 · 1 comment

Comments

@chang556
Copy link

chang556 commented Oct 3, 2022

AttributeError: module ‘tensorflow‘ has no attribute ‘contrib‘

how can use ,because we are usu openvino2021.4.2

@microboym
Copy link

I recently succeeded in converting my model with openvino2021.4.

  1. I created a separated virtual environment with anaconda, and run the following commands:
condo activate openvino-yolov4
conda install python==3.6.4
conda install pip
pip install tensorflow==1.15.5
pip install tqdm sklearn
python convert_weights_pb.py --class_names cfg/<your model>.names --weights_file <your model>.weights --data_format NHWC

which generated the frozen_darknet_yolov4_model.pb file.

  1. I used my os python /usr/bin/python3 to create a venv, which was different from the condo env I had created, because OpenVINO seemed not capable with anaconda.
bash # use a different shell that has not been init with conda. I used zsh before so now I used bash.
/usr/bin/python3 -m pip install virtualenv
/usr/bin/python3 -m virtualenv -p `which python3` <directory_for_environment>
source <directory_for_environment>/bin/activate
# Than follow the installation guide provided by intel.
source /opt/intel/openvino_2021/bin/setupvars.sh
cd /opt/intel/openvino_2021/deployment_tools/model_optimizer/install_prerequisites
sudo ./install_prerequisites_tf.sh ## DO NOT use ./install_prerequisites.sh or ./install_prerequisites_tf2.sh
  1. Finally, modify yolov4.json and run the mo script in the env created in step 2.
### Remember to use the same shell that you performed step2
python3 "/opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py" --input_model frozen_darknet_yolov4_model.pb --transformations_config yolov4.json --batch 1 --reverse_input_channels

Good luck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants