提交 c09e3109 编写于 作者: 李寅

Merge branch 'update-docs' into 'master'

Import filelock package when use it.

See merge request !658
......@@ -30,6 +30,9 @@ Required dependencies
* - sh
- pip install -I sh==1.12.14
- 1.12.14
* - Numpy
- pip install -I numpy==1.14.0
- Required by model validation
Optional dependencies
---------------------
......@@ -52,15 +55,12 @@ Optional dependencies
* - Docker
- `docker installation guide <https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository>`__
- Required by docker mode for Caffe model
* - Numpy
- pip install -I numpy==1.14.0
- Required by model validation
* - Scipy
- pip install -I scipy==1.0.0
- Required by model validation
* - FileLock
- pip install -I filelock==3.0.0
- Required by Android run
- Required by run on Android
.. note::
......
......@@ -160,6 +160,17 @@ There are two common advanced use cases:
   ├── mobilenet-v1.a
   └── mobilenet_v1.data
# model_graph_format: code
# model_data_format: code
builds
├── include
│   └── mace
│   └── public
│   ├── mace_engine_factory.h
│   └── mobilenet_v1.h
└── model
   └── mobilenet-v1.a
* **3. Deployment**
* Link `libmace.a` and `${library_name}.a` to your target.
......@@ -182,7 +193,7 @@ There are two common advanced use cases:
// Create Engine from compiled code
create_engine_status =
CreateMaceEngineFromCode(model_name.c_str(),
nullptr,
model_data_file, // empty string if model_data_format is code
input_names,
output_names,
device_type,
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import argparse
import filelock
import glob
import hashlib
import os
......
......@@ -13,7 +13,6 @@
# limitations under the License.
import falcon_cli
import filelock
import glob
import logging
import numpy as np
......@@ -69,10 +68,12 @@ def device_lock_path(serialno):
def device_lock(serialno, timeout=3600):
import filelock
return filelock.FileLock(device_lock_path(serialno), timeout=timeout)
def is_device_locked(serialno):
import filelock
try:
with device_lock(serialno, timeout=0.000001):
return False
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册