From: Eman Copty Date: Thu, 11 Jan 2018 02:45:23 +0000 (-0800) Subject: Changes for 1.12 release X-Git-Tag: accepted/tizen/unified/20191125.223343~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d3f6a8673186c74db6b50fb10abb7d3e0a7654cc;p=platform%2Fadaptation%2Fnpu%2Fintel-libmvnc.git Changes for 1.12 release --- diff --git a/api/python/mvnc/mvncapi.py b/api/python/mvnc/mvncapi.py index 523d6fa..cfdcace 100644 --- a/api/python/mvnc/mvncapi.py +++ b/api/python/mvnc/mvncapi.py @@ -187,8 +187,10 @@ class Device: for i in range(40): if v.raw[i * 50] != 0: ss = v.raw[i * 50:] - end = ss.find(0) - l.append(ss[0:end].decode()) + end = ss.find(b'\x00') + val = ss[0:end].decode() + if val: + l.append(val) return l if opt == DeviceOption.THERMAL_STATS: return numpy.frombuffer(v.raw, dtype=numpy.float32) diff --git a/api/src/mvnc_api.c b/api/src/mvnc_api.c index ff98ef0..2975836 100644 --- a/api/src/mvnc_api.c +++ b/api/src/mvnc_api.c @@ -449,7 +449,7 @@ mvncStatus mvncAllocateGraph(void *deviceHandle, void **graphHandle, (nstages - 1) * STAGE_LENGTH) / 2; // A reasonable check on graph correctness - if (nstages > 1024 || noutputs > 64 * 1024 * 1024) + if (noutputs > 64 * 1024 * 1024) return MVNC_UNSUPPORTED_GRAPH_FILE; pthread_mutex_lock(&mm); diff --git a/api/src/usb_link_vsc.c b/api/src/usb_link_vsc.c index f5d267e..d9c8f26 100644 --- a/api/src/usb_link_vsc.c +++ b/api/src/usb_link_vsc.c @@ -42,6 +42,9 @@ #define USB_TIMEOUT 10000 #define USB_MAX_PACKET_SIZE 1024 * 1024 * 10 +#define SLEEP_MS 100 +#define ITERATIONS 50 + static int usb_write(void *f, const void *data, size_t size) { while (size > 0) { @@ -110,7 +113,7 @@ void usblink_resetall() struct libusb_device_descriptor desc; libusb_device_handle *h; size_t i; - int rc, reset = 0; + int rc, iters = 0, cnt_bootrom = 0, cnt_runtime = 0, cnt_after = 0; if ((rc = libusb_get_device_list(NULL, &devs)) < 0) return; @@ -118,8 +121,13 @@ void usblink_resetall() while ((dev = devs[i++]) != NULL) { if (libusb_get_device_descriptor(dev, &desc) < 0) continue; + if (desc.idVendor == DEFAULT_VID && + desc.idProduct == DEFAULT_PID) + cnt_bootrom++; + // If Runtime device found, reset it if (desc.idVendor == DEFAULT_OPEN_VID && desc.idProduct == DEFAULT_OPEN_PID) { + cnt_runtime++; rc = libusb_open(dev, &h); if (rc < -1) continue; @@ -131,11 +139,28 @@ void usblink_resetall() PRINT_DEBUG(stderr, "Found stale device, resetting\n"); usblink_resetmyriad(h); usblink_close(h); - reset = 1; } } - if (reset) - usleep(1000000); + // If some devices needed reset + if(cnt_runtime > 0){ + iters = 0; + // Wait until all devices re-enumerate, or timeout occurs + while((cnt_after < cnt_bootrom + cnt_runtime) && (iters < ITERATIONS)){ + usleep(SLEEP_MS*1000); + cnt_after = 0; + if ((rc = libusb_get_device_list(NULL, &devs)) < 0) + return; + i = 0; + while ((dev = devs[i++]) != NULL) { + if ((rc = libusb_get_device_descriptor(dev, &desc)) < 0) + continue; + if (desc.idVendor == DEFAULT_VID && + desc.idProduct == DEFAULT_PID) + cnt_after++; + } + iters++; + } + } libusb_free_device_list(devs, 1); } diff --git a/docs/release_notes.md b/docs/release_notes.md index 7e3203d..f8987ea 100644 --- a/docs/release_notes.md +++ b/docs/release_notes.md @@ -1,20 +1,15 @@ ============================================================ # Movidius Neural Compute SDK Release Notes -# V1.11.00 2017-12-06 +# V1.12.00 2018-01-10 ============================================================ -As of V1.09.00, SDK has been refactored and contains many new features and structural changes. It is recommended you read the documentation to familiarize with the new features and contents. Please see v1.09.00 release notes, using github tag https://github.com/movidius/ncsdk/tree/v1.09.00.06 - ## SDK Notes: ### New features: -1. Tensorflow 1.4 supported. Tensorflow 1.4 is automatically installed on Ubuntu. -2. SSD supported in Caffe. ssd-caffe is automatically installed with this version. If a previous version of the SDK is installed, Berkeley Caffe is preserved and the symlink at /opt/movidius/caffe is moved to ssd caffe. +1. Improved compiler support for custom networks that use variable batch size via Tensorflow. +2. Improved description on how to use Tensorflow networks that were built for training. Please see "Guidence for Compiling TensorFlow Networks" in the SDK documentation #### Networks: -1. SSD Mobilenet v1 for caffe -2. TinyYolo v2 for Tensorflow via Darkflow transformation of original TinyYolo v2 +1. Facenet based on inception-resnet-v1 (see erratum #12) #### Layers: -1. L2 Normalization -2. Input ## API Notes: 1. No change @@ -32,7 +27,9 @@ Support for the following networks has been tested. 7. TinyYolo v1 8. VGG 16 9. Resnet 50 -10. SSD Mobilenet v1 +10. Resnet-18 +11. SSD Mobilenet v1 + ### Tensorflow r1.3 @@ -60,6 +57,7 @@ Support for the following networks has been tested. - MobileNet_v1_0.25_160 - MobileNet_v1_0.25_128 8. TinyYolo v2 via Darkflow tranformation +9. Facenet based on inception-resnet-v1 (See erratum #12) ## Firmware Features: 1. Convolutions @@ -88,13 +86,11 @@ Support for the following networks has been tested. 19. Batch Normalization 20. L2 Normalization 21. Input Layer - ## Bug Fixes: -1. Fixed: Most recent version of Inception_v4 run fails with FusedBatchNorm not supported error -2. Fixed: Installer deletes installation script, making review of installation process difficult -3. Fixed: Inception Resnet V2 failing with Stage Details Not Supported: FusedBatchNorm error -4. Fixed: Input layer can't be linked to multiple hidden layers +1. Fixed: Tensorflow FusedBatchNorm doesn't support fully connected layer inputs +2. Fixed: Mobilenets on Tensforflow 1.4 provide incorrect classification +3. Fixed: Resnet-18 on Caffe providing NaN results ## Errata: 1. Python 2.7 is fully supported for making user applications, but only the helloworld_py example runs as-is in both python 2.7 and 3.5 due to dependencies on modules. @@ -108,6 +104,6 @@ Support for the following networks has been tested. 9. Depth convolution is tested for 3x3 kernels. 10. A TanH layer’s “top” & “bottom” blobs must have different names.  This is different from a ReLU layer, whose “top” & “bottom” should be named the same as its previous layer. 11. On upgrade from previous versions of SDK, the installer will detect if openCV 3.3.0 was installed, for example from http://github.com/movidius/ncappzoo/apps/stream_ty_gn/install-opencv-from_source.sh. For this release, the installer will prompt to uninstall this specific version of openCV. This is required for ssd-caffe to run correctly. After 1.11 installation is complete, openCV 3.3.0 can be re-installed and the ssd-caffe will continue to function. -12. Resnet 18 is showing unexpected behavior for this release, and is being investigated. To use Resnet 18, please use version 1.10.01 of SDK. +12. Facenet requires L2 Normalization be inserted to be used, please see the support forum for a saver script example. 13. Although mvNCCheck shows per-pixel error for some metrics for mobilenet_v1_224, classification results are not impacted. -14. Initial validation has been done on SSD Mobilenet v1 and TinyYolo v2 but more thorough evaluation is underway. +14. Initial validation has been done on SSD Mobilenet v1 and TinyYolo v2 but more thorough evaluation is underway. diff --git a/docs/tools/check.md b/docs/tools/check.md index 9cc6158..498d6f1 100644 --- a/docs/tools/check.md +++ b/docs/tools/check.md @@ -8,9 +8,8 @@ Revision|1.08 See also| [mvNCCompile](compile.md), [mvNCProfile](profile.md), [TensorFlow™ Info](../TensorFlowUsage.md) ## Overview -This command line tool compiles the provided network, runs the network on the connected Intel® Movidius™ Neural Compute Stick (Intel® Movidius™ NCS), and creates a text/HTML profiling output. The profiling data contains layer-by-layer stats about the performance of the input network. This is very helpful in determining how much time is spent on each layer, and is helpful in determining changes to the network to improve the total inference time for a network on the Intel Movidius NCS. +This command line tool checks the results for an inference on the connected Intel® Movidius™ Neural Compute Stick (Intel® Movidius™ NCS) vs. the caffe results on the host computer for the provided network. -The weights file is not required when profiling a network to determine bottlenecks. ## Syntax diff --git a/examples/caffe/AlexNet/Makefile b/examples/caffe/AlexNet/Makefile index f6b0c26..b738de5 100644 --- a/examples/caffe/AlexNet/Makefile +++ b/examples/caffe/AlexNet/Makefile @@ -83,7 +83,7 @@ compile: prototxt caffemodel check: prototxt caffemodel @echo "\nmaking check" #-${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M ../../data/ilsvrc12/ilsvrc_2012_mean.npy - -${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -M 110 -S 255 + -${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -M 110 -S 255 -metric top1 .PHONY: run run: compile diff --git a/examples/caffe/GoogLeNet/Makefile b/examples/caffe/GoogLeNet/Makefile index 5e2c6fd..8b0b918 100644 --- a/examples/caffe/GoogLeNet/Makefile +++ b/examples/caffe/GoogLeNet/Makefile @@ -84,7 +84,7 @@ compile: prototxt caffemodel check: prototxt caffemodel @echo "\nmaking check" #-${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M ../../data/ilsvrc12/ilsvrc_2012_mean.npy - ${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/nps_electric_guitar.png -s 12 -id 546 ${PROTOTXT_FILENAME} -S 255 -M 110 + ${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/nps_electric_guitar.png -s 12 -id 546 ${PROTOTXT_FILENAME} -S 255 -M 110 -metric top1 .PHONY: run run: compile diff --git a/examples/caffe/SqueezeNet/Makefile b/examples/caffe/SqueezeNet/Makefile index 6aec28b..4d42b16 100644 --- a/examples/caffe/SqueezeNet/Makefile +++ b/examples/caffe/SqueezeNet/Makefile @@ -92,7 +92,7 @@ compile: prototxt caffemodel check: prototxt caffemodel @echo "\nmaking check" #-${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M ../../data/ilsvrc12/ilsvrc_2012_mean.npy - ${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M 120 + ${NCCHECK} -w ${CAFFEMODEL_FILENAME} -i ../../data/images/cat.jpg -s 12 -id 281 ${PROTOTXT_FILENAME} -S 255 -M 120 -metric top1 .PHONY: run run: compile diff --git a/examples/tensorflow/inception_v1/Makefile b/examples/tensorflow/inception_v1/Makefile index 79a4ae6..0b9c057 100644 --- a/examples/tensorflow/inception_v1/Makefile +++ b/examples/tensorflow/inception_v1/Makefile @@ -52,7 +52,7 @@ compile: weights .PHONY: check check: weights - -${NCCHECK} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} -i ../../data/images/cat.jpg -id 829 -S 2 -M 128 -cs 0,1,2 + -${NCCHECK} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} -i ../../data/images/cat.jpg -id 829 -S 2 -M 128 -cs 0,1,2 -metric top1 .PHONY: run run: compile diff --git a/examples/tensorflow/inception_v1/graph b/examples/tensorflow/inception_v1/graph index 3f18501..e5d5ae4 100644 Binary files a/examples/tensorflow/inception_v1/graph and b/examples/tensorflow/inception_v1/graph differ diff --git a/examples/tensorflow/inception_v3/Makefile b/examples/tensorflow/inception_v3/Makefile index 42aeb76..bde24c4 100644 --- a/examples/tensorflow/inception_v3/Makefile +++ b/examples/tensorflow/inception_v3/Makefile @@ -48,7 +48,7 @@ compile: weights .PHONY: check check: weights - -${NCCHECK} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} -i ../../data/images/cat.jpg -id 917 -M 128 -S 2 -cs 0,1,2 + -${NCCHECK} -s 12 ${MODEL_FILENAME} ${INPUT_NODE_FLAG} ${OUTPUT_NODE_FLAG} -i ../../data/images/cat.jpg -id 917 -M 128 -S 2 -cs 0,1,2 -metric top1 .PHONY: run run: compile diff --git a/examples/tensorflow/inception_v3/graph b/examples/tensorflow/inception_v3/graph index 35c4648..3e8ead8 100644 Binary files a/examples/tensorflow/inception_v3/graph and b/examples/tensorflow/inception_v3/graph differ diff --git a/install.sh b/install.sh index aff80c9..9976f01 100644 --- a/install.sh +++ b/install.sh @@ -11,10 +11,10 @@ then cd /tmp else cd /tmp - wget --no-cache http://ncs-forum-uploads.s3.amazonaws.com/ncsdk/ncsdk_01_11/ncsdk_redirector.txt + wget --no-cache http://ncs-forum-uploads.s3.amazonaws.com/ncsdk/ncsdk_01_12/ncsdk_redirector.txt fi -download_filename=NCSDK-1.11.tar.gz +download_filename=NCSDK-1.12.tar.gz # redirector is the url from redirector text file redirector=$(