Ary Maulana
Ary Maulana

Reputation: 47

openVino: __cinit__() got an unexpected keyword argument 'weights'

I'm trying to run this repo but found an error. PPE-detector-Tiny-YOLOv3-Rasp.erry-PI-and-NCS2

I never used python before. when I run the PPE_Detector_Pc.py I got an error like this :

PS D:\repository\PPE-detector-Tiny-YOLOv3-Rasp.erry-PI-and-NCS2> py PPE_Detector_Pc.py
loading the model...
loading plugin on Intel NCS2...
Traceback (most recent call last):
  File "PPE_Detector_Pc.py", line 406, in <module>
    sys.exit(main_IE_infer() or 0)
  File "PPE_Detector_Pc.py", line 201, in main_IE_infer
    net = IENetwork(model=path_to_xml_file, weights=path_to_bin_file)
  File "ie_api.pyx", line 1598, in openvino.inference_engine.ie_api.IENetwork.__cinit__
TypeError: __cinit__() got an unexpected keyword argument 'weights'

this is the part where it gave me error:

path_to_xml_file = "tiny_yolo_IR_500000_FP32.xml" #<--- MYRIAD
path_to_bin_file = os.path.splitext(path_to_xml_file)[0] + ".bin"

time.sleep(1)
print("loading plugin on Intel NCS2...")

plugin = IECore()
net = IENetwork(model=path_to_xml_file, weights=path_to_bin_file)
input_blob = next(iter(net.inputs))
exec_net = plugin.load(network=net)

my path_to_xml_file and path_to_bin_file was using tiny_yolo_IR_500000_FP32.xml and tiny_yolo_IR_500000_FP32.bin i put in same folder i downloaded from the repo.

I just changed IEPlugin to IECore because it is no longer supported on the newer version openVino.

is there anything I miss on that?

Upvotes: 0

Views: 1203

Answers (1)

Hairul_Intel
Hairul_Intel

Reputation: 171

The repository you've provided is not maintained by OpenVINO™ and is using deprecated APIs.

You're partially correct on steps to replace IEPlugin with IECore. Here are the full steps required to read and load networks using IECore API:

ie = IECore()
net = ie.read_network(model=model_xml, weights=model_bin)
exec_net = ie.load_network(network=net, device_name="CPU", num_requests=2)

The provided IR models (.xml and .bin files) from the repository are also in deprecated version as they are IR version 5 as shown here when running the edited code in OpenVINO™ Development Tools 2022.1:

IRv5 Error

To avoid this error, you will need to convert the original model into the latest IR format (IR v11) using OpenVINO™ 2022.1 Model Optimizer.

Upvotes: 1

Related Questions