Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

RuntimeError: Failed to allocate graph: NC_ERROR when loading model to MYRIAD


I implemented Fast-SCNN real-time segmentation network in TensorFlow 1.14 using Keras. I successfully turned frozen graph to intermediate representation, xml and bin files were generated. I was using the latest Model Optimizer version. When i tried to load the model to MYRIAD device, I got the following error

[ INFO ] Creating Inference Engine
[ INFO ] Loading network files:
[ INFO ] Preparing input blobs
[ INFO ] Loading model to the plugin
E: [global] [     37406] [python3] XLinkReadData:165	addEventWithPerf(&event, &opTime) failed with error: 3
E: [ncAPI] [     37406] [python3] ncGraphAllocate:2053	Can't read input tensor descriptors of the graph, rc: X_LINK_COMMUNICATION_FAIL
Traceback (most recent call last):
  File "", line 141, in <module>
    sys.exit(main() or 0)
  File "", line 94, in main
    exec_net = ie.load_network(network=net, device_name=args.device)
  File "ie_api.pyx", line 134, in openvino.inference_engine.ie_api.IECore.load_network
  File "ie_api.pyx", line 141, in openvino.inference_engine.ie_api.IECore.load_network
RuntimeError: Failed to allocate graph: NC_ERROR
E: [global] [     37480] [Scheduler00Thr] dispatcherEventSend:53	Write failed (header) (err -4) | event XLINK_CLOSE_STREAM_REQ

E: [xLink] [     37480] [Scheduler00Thr] sendEvents:1036	Event sending failed
E: [global] [     37480] [Scheduler00Thr] dispatcherEventSend:53	Write failed (header) (err -4) | event XLINK_RESET_REQ

E: [xLink] [     37480] [Scheduler00Thr] sendEvents:1036	Event sending failed
E: [ncAPI] [     47480] [python3] ncDeviceClose:1838	Device didn't appear after reboot

I'm not sure where the problem is. One thing that I'm suspecting is that the network is using depthwise convolution layers. I haven't found information here whether or not the operation is supported on MYRIAD. I have found here that the optimizer is supporting that operation in TensorFlow. I would appreciate your advice.

0 Kudos
3 Replies

The problem was that the input size was too large (1024 x 2048 x 3) so I guess the stick doesn't allow such big input sizes, I lowered it to (512 x 1024 x 3) and the net was successfully loaded to the stick.

0 Kudos

This is the second result from a google search for Failed to allocate graph: NC_ERROR so for anyone who gets here, the answer to this person's question is almost certainly that their device ran out of memory. At a glance the model that they used is Fully Convolutional, and any model that uses Convolutions, the size of the model is a function of the input size. That is, a larger resolution produces a larger model, and a smaller resolution produces a smaller model. The output of a Convolution (with stride 1) is a tensor the size of the input, and with stride <1 it is a function of the input, and so a larger input requires that more memory be allocated for use; it's more complicated than that I and I suggest you read about convolutions because it's actually quite simple to understand. I have never seen input size limits in MYRIAD, but I doubt that this was an input size limit, and almost certainly just running out of memory.


Hi, have you a link for install NCS2 on Windows 11 and OpenVINO2022.3 or Ubuntu 22.04 ?

0 Kudos