Notifications
Clear all

Unable to install NC-SDK due to pip error

 

(@aymanchaudhry)
Active Member
Joined: 2 years ago
Posts: 3
Topic starter  

Hi,

I'm trying to install the NC-SDK package on my host Linux machine (Ubuntu 20.04) without Caffe support, but I have been reaching an error mid-way through the installation. The error occurs in the pip stage, where it is building wheel for numpy. I've attached a full log of the commands I ran along with the messages outputted to the terminal.

The prerequisites have been installed (except Caffe) using the Getting Started Guide provided in the pumpkin software package.

I'm happy to provide more information if it is needed.

Kind Regards,

Ayman

This topic was modified 2 years ago by aymanChaudhry

   
Quote
(@paulbuxton)
Member Moderator
Joined: 3 years ago
Posts: 15
 

Hi,

 

We have seen this issue as well. The problem is that the latest ubuntu 20.04 release has broken something. I have contacted the development team for a proper fix.

In the meantime it may be possible to use an older Ubuntu 20.04 image from

http://old-releases.ubuntu.com/releases/20.04.3/

Install the NCSDK before doing an apt-get upgrade.


   
ReplyQuote
(@aymanchaudhry)
Active Member
Joined: 2 years ago
Posts: 3
Topic starter  

Hi Paul,

 

I'm now using an older Ubuntu 20.04 version from the link you provided and no longer hit that issue.

 

However, during the installation, two verifications are unsuccessful. I've attached the verification log below:

 

Kind Regards,

Ayman

INSTALLER: 

CONFIG: VERIFY_INSTALLATION=true
  - VERIFYING INSTALLATION

INSTALLER: ** Verifying Installation **
INSTALLER:     Verifying TensorFlow installation:
INSTALLER: Importing TensorFlow verification test commandlines from file:
    commandlines.txt

INSTALLER: Executing verification commandline:
           python ../../scripts/tf_imgnnvm.py --input sampleconv.pb --output_imgnnvm sampleconv_from_TF.imgir -ps

img_ndk_tools_install.sh: line 602: 25956 Illegal instruction     (core dumped) python ../../scripts/tf_imgnnvm.py --input sampleconv.pb --output_imgnnvm sampleconv_from_TF.imgir -ps
INSTALLER: ERROR RUNNING COMMAND: python ../../scripts/tf_imgnnvm.py --input sampleconv.pb --output_imgnnvm sampleconv_from_TF.imgir -ps

INSTALLER: Verification failed (execution)!

INSTALLER:     Verifying NNVM ONNX Frontend installation:
INSTALLER: Importing ONNX verification test commandlines from file:
    commandlines.txt

INSTALLER: Executing verification commandline:
           python ../../scripts/onnx_imgnnvm.py --input sampleconv.onnx --output_imgnnvm sampleconv_from_ONNX.imgir -ps

Traceback (most recent call last):
  File "../../scripts/onnx_imgnnvm.py", line 17, in <module>
    import onnx
  File "/home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/nnvm_ndk_tools_env/lib/python3.8/site-packages/onnx/__init__.py", line 9, in <module>
    from onnx.external_data_helper import load_external_data_for_model, write_external_data_tensors
  File "/home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/nnvm_ndk_tools_env/lib/python3.8/site-packages/onnx/external_data_helper.py", line 10, in <module>
    from .onnx_pb import TensorProto, ModelProto
  File "/home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/nnvm_ndk_tools_env/lib/python3.8/site-packages/onnx/onnx_pb.py", line 8, in <module>
    from .onnx_ONNX_REL_1_7_ml_pb2 import *  # noqa
  File "/home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/nnvm_ndk_tools_env/lib/python3.8/site-packages/onnx/onnx_ONNX_REL_1_7_ml_pb2.py", line 32, in <module>
    _descriptor.EnumValueDescriptor(
  File "/home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/nnvm_ndk_tools_env/lib/python3.8/site-packages/google/protobuf/descriptor.py", line 755, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information:  https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates 
INSTALLER: ERROR RUNNING COMMAND: python ../../scripts/onnx_imgnnvm.py --input sampleconv.onnx --output_imgnnvm sampleconv_from_ONNX.imgir -ps

INSTALLER: Verification failed (execution)!

INSTALLER:     Verifying NNVM TFLite Frontend installation:
INSTALLER: Importing TFLite verification test commandlines from file:
    commandlines.txt

INSTALLER: Executing verification commandline:
           python ../../scripts/tflite_imgnnvm.py --input sampleconv.tflite --output_imgnnvm sampleconv_from_TFLite.imgir -ps

[Adapter][INFO] TFLite to IMG NNVM Converter:
[Adapter][INFO] convert_network() - Conversion started...
[Adapter][INFO] Source TensorFlow Lite network (.tflite): sampleconv.tflite
[Adapter][INFO] CONVERTING TO IMG-NNVM:
[IMGDNN][INFO] Performing the following transforms: REMOVE_DROPOUT, DUPLICATE_PARAMS, INTO_ATROUS_CONV, INTO_LEAKY_RELU, EXPAND_DIMS_TO_RESHAPE, MERGE_CONV2D_BIAS, FUSE_BATCH_NORM, SPLIT_QUANT_CONV2D, INTO_SOFTMAX, FOLD_CONSTANTS, REMOVE_FLATTEN
[Adapter][INFO] Writing out IMG-NNVM graph and params files
[Adapter][INFO] Created files: sampleconv_from_TFLite.imgir, sampleconv_from_TFLite.imgir.params
[Adapter][INFO] CONVERSION COMPLETED!

INSTALLER: Verification succeeded!

INSTALLER:     Copying imgir sample for verification tools
INSTALLER:     Verifying NNVM Graph Partition installation:
INSTALLER: Importing Graph_Partition verification test commandlines from file:
    commandlines.txt

INSTALLER: Executing verification commandline:
           python ../../scripts/graph_partition_imgnnvm.py -i ../imgir/sampleconv.imgir -sp [Src:ConvOp1],[ConvOp2:ConvOp2], -o test_split_net_0.imgir,test_split_net_1.imgir -ps

[Graph Partition][INFO] Loading NNVM graph and params.
[Graph Partition][INFO] Spliting network.
[Graph Partition][INFO] Created 4 files: test_split_net_0.imgir , test_split_net_0.imgir.params
test_split_net_1.imgir , test_split_net_1.imgir.params
[Graph Partition][INFO] GRAPH PARTITIONING DONE!
INSTALLER: Verification succeeded!

INSTALLER:     Verifying NNVM Graph Transform installation:
INSTALLER: Importing Graph_Transform verification test commandlines from file:
    commandlines.txt

INSTALLER: Executing verification commandline:
           python ../../scripts/graph_transform_imgnnvm.py -i ../imgir/sampleconv.imgir -o sampleconv_transformed.imgir -t TRAVERSE_GRAPH,INPUT_TO_NCHW,TRAVERSE_GRAPH -ps

[Graph Transforms][INFO] Loading NNVM graph and params.
[Graph Transforms][INFO] Created traverse_graph.txt.
[Graph Transforms][INFO] INPUT_TO_NCHW transform modified 1 nodes
[Graph Transforms][INFO] Created traverse_graph.txt.
[Graph Transforms][INFO] Writing out IMG-NNVM graph and params files
[Graph Transforms][INFO] Created 2 files: sampleconv_transformed.imgir, sampleconv_transformed.imgir.params
[Graph Transforms][INFO] GRAPH TRANSFORMATION DONE!
INSTALLER: Verification succeeded!

INSTALLER: ********************************************
INSTALLER: *    IMG NDK TOOLS INSTALLATION COMPLETE    
INSTALLER: *-------------------------------------------
INSTALLER: * INSTALLED (PATCHED) COMPONENTS:           
INSTALLER: *                                           
INSTALLER: * TENSORFLOW:                   true        
INSTALLER: *                                       
INSTALLER: * ONNX:                         true        
INSTALLER: *                                       
INSTALLER: *                                           
INSTALLER: * TVM/NNVM:                     true        
INSTALLER: *   TVM CUDA SUPPORT:           OFF        
INSTALLER: *   TVM LLVM SUPPORT:           /home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/imgtvm/dependencies/LLVM/bin/llvm-config        
INSTALLER: *   NNVM CAFFE FRONTEND:        false        
INSTALLER: *   NNVM TFLITE FRONTEND:       true        
INSTALLER: *                                            
INSTALLER: * CONVERSION SCRIPTS INSTALLED: true        
INSTALLER: *****************************************

INSTALLER: ***********************************************
INSTALLER: *          - VERIFICATION RESULTS -              *
INSTALLER: *------------------------------------------------*
INSTALLER: * CONVERSION TESTS:                              *
INSTALLER: * TensorFlow to IMG-NNVM: (0/1) PASSED - FAILURE *
INSTALLER: * TFLite to IMG-NNVM:     (1/1) PASSED - SUCCESS *
INSTALLER: * ONNX to IMG-NNVM:       (0/1) PASSED - FAILURE *
INSTALLER: * Graph Partition:        (1/1) PASSED - SUCCESS *
INSTALLER: * Graph Transform:        (1/1) PASSED - SUCCESS *
INSTALLER: **************************************************
INSTALLER: 
VERIFICATION FAILED!

INSTALLER: 

SWITCH TO THE NEW VIRTUAL ENVIRONMENT USING:
   'source /home/ayman/pumpkin/powervr-nc-sdk-ac-v0.2.2/ncsdk/nnvm_ndk_tools_env/bin/activate'
TO USE THESE TOOLS.

DEVTOOLS INSTALLER: ERROR DURING DEVELOPMENT PACKAGE INSTALLATION/VERIFICATION!

   
ReplyQuote
(@paulbuxton)
Member Moderator
Joined: 3 years ago
Posts: 15
 

I will check with the dev teams, but my first guess is that this is related to running in a VM. Would I be correct in thinking you are running in a virtual machine like VirtualBox?

I suspect the problem you are seeing is that one ML frameworks is attempting to use the AVX extensions that are part of most modern processors, but which you likely need to enable specifically in the VM image, the VM Software may also clash if you are using both virtual machines and Windows Subsystem for Linux.


   
ReplyQuote
(@aymanchaudhry)
Active Member
Joined: 2 years ago
Posts: 3
Topic starter  

Hi Paul,

I’m using a virtual machine created in VirtualBox. The image I'm using is the Ubuntu 20.04 one from the link you had provided.

Kind regards,

Ayman


   
ReplyQuote
(@luispimo)
Member Admin
Joined: 5 years ago
Posts: 17
 

@aymanchaudhry I'm sorry I missed this thread.

Try to select the appropriate version of Protobuf Python package prior to install the NC-SDK:

$ pip install protobuf==3.20.0

Regards

Luis


   
ReplyQuote