A
abroekhof

  • Jun 22, 2023
  • Joined Jun 29, 2022
  • 0 best answers
  • Still trying to figure out how to get YOLOv7 running on FFC-6P (RVC3). From https://discuss.luxonis.com/d/1565-compiling-model-for-rvc3-interpolate-node-has-unsupported-number-of-inputs-3/3, I need to use OpenVINO 2021.4 to get it to use the correct node for Resize, but now hitting a new issue when I run compile_tool:

    root@keembay:~# /opt/openvino/tools/compile_tool/compile_tool -d VPUX.3400 -m ~/Downloads/yolov7-tiny.xml -ip U8            
    OpenVINO Runtime version ......... 2022.1.0
    Build ........... 2022.1.0-7080-6582ec65d78-releases/2022/1
    Network inputs:
        images : u8 / [...]
    Network outputs:
        output/sink_port_0 : f32 / [...]
    
    Callback signal handler installed
    
    Opening XLink Device File
    error: ConvertShapeTo4D Pass failed : Tensors with rank > 4 are not supported
    Compilation failed

    The rank 5 tensors are at the end of the model:

    I'm tempted to just drop those sigmoids but they look fairly important.

    Any ideas on how to fix this? Is rank 5 supported in later version of OpenVINO?

    • OpenVINO 2021.4 does indeed get farther, but now hitting a new error, that compile_tool only supports tensors of rank 4, not 5. Will open a new issue

      • Trying again at this…

        My best guess is that compile_tool is looking for the 4th input to be specified, even though it's marked as optional in the API. I presume this is a bug with OV 2022.1.0.

        I tried to modify the XML to use the 2-input version, but realize that I would need to change the .bin file as well, which I don't understand how to do. My best guess is to modify the ONNX file instead, but haven't figured that out yet.

        Might try OV 2021 to see if that works any better.

      • Oh, one other thing to try, put

        mp.set_start_method('spawn')

        at the top of your main function.

        • I have a model that works on on OAK-D, based on YOLOv7-tiny, but having trouble compiling for RVC3. Following the instructions here. Error is:

          root@keembay:~/Downloads# /opt/openvino/tools/compile_tool/compile_tool -d VPUX.3400 -m model.xml -ip U8  -ov_api_1_0
          OpenVINO Runtime version ......... 2022.1.0
          Build ........... 2022.1.0-7080-6582ec65d78-releases/2022/1
          Network inputs:
              images : U8 / NCHW
          Network outputs:
              boxes.0 : FP32 / CHW
              classes : FP32 / CHW
              max_score : FP32 / CHW
          
          Callback signal handler installed
          
          Opening XLink Device File
          nGraph Interpolate node '/model.39/Resize' has unsupported number of inputs '3'

          The layer in question:

          <layer id="282" name="/model.39/Resize" type="Interpolate" version="opset4">
          			<data mode="nearest" shape_calculation_mode="scales" coordinate_transformation_mode="asymmetric" nearest_mode="floor" antialias="false" pads_begin="0, 0, 0, 0" pads_end="0, 0, 0, 0" cube_coeff="-0.75" />
          			<input>
          				<port id="0" precision="FP32">
          					<dim>1</dim>
          					<dim>128</dim>
          					<dim>15</dim>
          					<dim>15</dim>
          				</port>
          				<port id="1" precision="I64">
          					<dim>4</dim>
          				</port>
          				<port id="2" precision="FP32">
          					<dim>4</dim>
          				</port>
          			</input>
          			<output>
          				<port id="3" precision="FP32" names="/model.39/Resize_output_0">
          					<dim>1</dim>
          					<dim>128</dim>
          					<dim>30</dim>
          					<dim>30</dim>
          				</port>
          			</output>
          		</layer>

          In opset4 the inputs of Interpolate increased to 4, but it's not clear what the compiler is expecting here. Also unclear as to why this worked for RVC2—did it know how to interpret the Interpolate layer properly?

        • No luck, now just using a different device. I did notice that some firewall settings were preventing me from SSH'ing in, but not sure if that's at all related to the bootloop.

        • Hi @AlessandroB we're able to connect to cameras in separate processes, looks something like this.

          for info in infos:
              # Converts enum eg. 'XLinkDeviceState.X_LINK_UNBOOTED' to 'UNBOOTED'
              state = str(info.state).split('X_LINK_')[1]
              logging.info(
                  'Found device %s, MxId: %s, State: %s', info.name, info.mxid, state
              )
              proc = mp.Process(
                  target=cam_process,
                  name=info.mxid,
                  args=(
                      log_queue,
                      info.mxid,
                      data_queue,
                      exit_event,
                  ),
                  daemon=True,
              )
              procs.append(proc)
              proc.start()
          • Our 6P appears to be in a boot loop, as the USB device number is changing every few seconds, and I can no longer ssh in, or see it with ip a or ifconfig.

            I started with a fresh device and was able to ssh in, after changing the static IP on usb0 to 192.168.197.10/24.

            However, I then tried to update the firmware to the latest version by running:

            mender -install luxonisos-1.8.dm-verity.mender ; reboot

            After this, I am no longer able to see the device as described above. I have tried flashing various versions (1.2, 1.4) using the recovery SW, e.g:

            flashtool flashall fip-oak-ffc-6p-rvc3-1.2.0.bin boot.img data.img system.img syshash.img

            This goes through successfully:

            (tmp) user@host:~/Downloads/14$ flashtool flashall fip-oak-ffc-6p-rvc3-1.2.0.bin boot.img data.img system.img syshash.img
            /home/user/Downloads/14/fip-oak-ffc-6p-rvc3-1.2.0.bin is a valid FIP
            /home/user/Downloads/14/boot.img is a valid boot image
            /home/user/Downloads/14/data.img is a valid data image
            /home/user/Downloads/14/system.img is a valid system image
            /home/user/Downloads/14/syshash.img is a valid verity image
            FIP flashed to device: 5272C816838860C6
            Waiting 30s before reenumarating
            FIP flashed successfully for device 1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 created GPT in 0.0150s
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed boot_a in 13.2160s
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed boot_b in 13.0090s
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed data in 20.6630s
            |  Downloading..
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed system_a in 295.9090s
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed system_b in 381.1670s
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed syshash_a in 5.3360s
            1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6 flashed syshash_b in 5.3080s
            OS flashing done for device 1-6 Intel Keembay USB(in OS recovery mode): 5272C816838860C6. Please shutdown the system, set the boot switch to normal and reboot the system
            Unable to find or flash PCIe devices due to missing drivers. If you intend to flash a PCIe device, please install the drivers and rerun the tool

            But still is in bootloop. I have tried unplugging and replugging many times.

            Any ideas on how to recover?

            • Hi erik, thanks for your response. Does this mean that getDeviceByMxID has been fixed in recent versions to accept MxIds for PoE devices?

              • erik replied to this.
              • I'm attempting to use multiple OAK-D-POE on a single host. I was planning on addressing using the MxId, but I see that for PoE devices, getDeviceByMxID needs the IP address instead of the MxId (at least for v.2.10.0, which we're using). I'm guessing it'll be possible to assign IPs to the cameras, but are there any plans on making the MxId addressing work?

                This post seems to suggest as much, but can't tell what progress was made: https://discuss.luxonis.com/d/434-dai-devicebootloader-getallavailabledevices-not-working-in-c/2

                • erik replied to this.