Code Monkey home page Code Monkey logo

aml-hardware-accelerated-models's Introduction

page_type languages products description urlFragment
sample
python
csharp
azure
These samples assume you are familiar with the Azure ML Hardware Accelerated Models (HAM) product.
aml-hardware-accelerated-models

Azure Machine Learning Hardware Accelerated Models - Samples

Getting Started

These samples assume you are familiar with the Azure ML Hardware Accelerated Models (HAM) product. If not, you can read more here. The samples in this repo are:

  • Deploy to Data Box Edge
    • Follow these sample notebooks if you have a Databox Edge machine. Data Box Edge is an on-premise server that is enabled with an FPGA. Read more here.

Quickstart

git clone https://github.com/Azure-Samples/aml-hardware-accelerated-models.git
cd aml-hardware-accelerated-models
pip install azureml-accel-models[cpu]
pip install jupyter
jupyter notebook

aml-hardware-accelerated-models's People

Contributors

borisneal avatar csteegz avatar microsoftopensource avatar msftgits avatar paledger avatar v-hearya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aml-hardware-accelerated-models's Issues

Deploy to Edge via SDK - missing pip install azureml-contrib-iot

ipynb fails at Line 18

from azureml.contrib.core.compute import IotHubCompute


# If you haven't attached your Data Box Edge's IoT Hub as compute
config = IotHubCompute.attach_configuration(name=iot_hub_name, resource_group=resource_group, connection_string=connection_string)
iothub_compute = IotHubCompute.attach(ws, iot_device_id, config)
iothub_compute.wait_for_completion()



---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-18-9759e54235ca> in <module>
      1 #from azureml.contrib.iot.compute import IotHubCompute
----> 2 from azureml.contrib import IotHubCompute
      3 
      4 # If you haven't attached your Data Box Edge's IoT Hub as compute
      5 config = IotHubCompute.attach_configuration(name=iot_hub_name, resource_group=resource_group, connection_string=connection_string)

ImportError: cannot import name 'IotHubCompute'

Remedy is to edit package list

Change this code block

%%bash
pip install azure-cli # Install Azure CLI
az extension add --name azure-cli-iot-ext # Add IoT CLI extension
pip install -U jupyter_console # Fix Jupyter dependencies overridden by Azure CLI installation
pip install docker # Install Docker
pip install azureml-accel-models[cpu]
az login # Log into Azure account

and include

pip install azureml-contrib-iot

support for tensorflow==2.x.x

Client App crashes at Line 56 of run.py

if incorrect version of tensorflow is used; an error occurs
Specifically at

# Using the grpc client in AzureML Accelerated Models SDK
from azureml.accel import PredictionClient
prediction_client = PredictionClient(args.address, args.port)

results = prediction_client.score_file(path=os.path.join(args.image_dir, image), 
                                                        input_name=args.input_tensors, 
                                                        outputs=args.output_tensors

Error Message from IOTHub at Databox Edge

Trying again in 10 seconds...
IoT Hub responded to message with status: OK
Unable to inference for unknown reason. See stack trace below:
Traceback (most recent call last):
  File "run.py", line 56, in main
    outputs=args.output_tensors)
  File "/usr/local/lib/python3.5/dist-packages/azureml/accel/_client.py", line 77, in score_file
    result = self.score_tensors(input_map, outputs, timeout)
  File "/usr/local/lib/python3.5/dist-packages/azureml/accel/_client.py", line 128, in score_tensors
    return self.__predict(request, timeout, outputs=outputs)
  File "/usr/local/lib/python3.5/dist-packages/azureml/accel/_client.py", line 160, in __predict
    return tf.contrib.util.make_ndarray(result.outputs[output_names])
AttributeError: module 'tensorflow' has no attribute 'contrib'

pip list | grep azureml

azureml-accel-models                  1.0.76       
azureml-automl-core                   1.0.76       
azureml-automl-runtime                1.0.76.1     
azureml-contrib-datadrift             1.0.74       
azureml-contrib-interpret             1.0.74       
azureml-contrib-iot                   1.0.76       
azureml-contrib-notebook              1.0.76       
azureml-contrib-opendatasets          1.0.45       
azureml-contrib-pipeline-steps        1.0.76       
azureml-contrib-reinforcementlearning 0.1.0.5919674
azureml-contrib-server                1.0.76       
azureml-contrib-services              1.0.76       
azureml-core                          1.0.76       
azureml-datadrift                     1.0.74       
azureml-dataprep                      1.1.30       
azureml-dataprep-native               13.1.0       
azureml-defaults                      1.0.76       
azureml-explain-model                 1.0.74       
azureml-interpret                     1.0.74       
azureml-mlflow                        1.0.74       
azureml-model-management-sdk          1.0.1b6.post1
azureml-opendatasets                  1.0.74       
azureml-pipeline                      1.0.76       
azureml-pipeline-core                 1.0.76       
azureml-pipeline-steps                1.0.76       
azureml-samples                       0+unknown    
azureml-sdk                           1.0.76       
azureml-telemetry                     1.0.76       
azureml-tensorboard                   1.0.74       
azureml-train                         1.0.76       
azureml-train-automl                  1.0.76       
azureml-train-automl-client           1.0.76       
azureml-train-automl-runtime          1.0.76.1     
azureml-train-core                    1.0.76       
azureml-train-restclients-hyperdrive  1.0.76       
azureml-widgets                       1.0.76      

Fix can be done by changing Dockerfile

RUN pip3 install --upgrade pip && \
    pip install setuptools && \
    pip install tensorflow==1.5.0

Inference fails as a script, but not interactive

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

docker run -i -t ubuntu:18.04 bash
apt update && apt-get install -y libgtk2.0-dev python3.6 python3-pip openssh-client vim
pip3 install opencv-python azureml-accel-models tensorflow==1.6 #1.14 did not work

copy the content from https://github.com/Azure-Samples/aml-hardware-accelerated-models/tree/master/finetune-ssd-vgg/tfssd to /tfssd

i use scp -r [email protected]:/home/kevinsay/test/tfssd/* /tfssd/

after running https://github.com/Azure-Samples/aml-hardware-accelerated-models/blob/master/finetune-ssd-vgg/notebooks/Finetune%20VGG%20SSD.ipynb, copy the content from ~/azml_ssd_vgg/vggssd/1.1.3 to /model

i use scp -r [email protected]:/home/kevinsay/test/model/* /model/

Run python3 and past the following into the interactive shell and it works fine

Save the following as test.py and attempt to run python3 test.py == you will never see the line "INFO:tensorflow:Restoring parameters from /model/vggssd/1.1.3/ssd_vgg_bw"

import sys
import cv2
import os
import tensorflow as tf
sys.path.insert(0, '/tfssd/')
from finetune.inference import InferVggSsd
checkpointDirectory = "/model"
useGPU = False
infer = InferVggSsd(checkpointDirectory, gpu=useGPU)
print("done")

Any log messages given by the failure

None

Expected/desired behavior

I expected to see "INFO:tensorflow:Restoring parameters from /model/vggssd/1.1.3/ssd_vgg_bw" when running in script and I did not.

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
Ubuntu 18.04

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.