Device.open()
Info | Value |
---|---|
Package | mvnc |
Module | mvncapi |
Version | 2.0 |
See also | Device, Device.close(), Device.destroy() |
Overview
This method initializes the neural compute device and opens communication.
Upon successful return from this method, the Device will be ready for use.
Device communication is closed with Device.close().
Syntax
device.open()
Parameters
None.
Return
None
Raises
Exception with a status code from Status if underlying function calls return a status other than Status.OK.
Notes
- The Device must be opened with this method before being used with any API functions other than Device.get_option() or Device.set_option(). When the device has been successfully opened, the device state will be OPENED.
Example
from mvnc import mvncapi
# Get a list of valid device identifiers
device_list = mvncapi.enumerate_devices()
# Create a Device instance for the first device found
device = mvncapi.Device(device_list[0])
# Open communication with the device
device.open()
#
# Use the device...
#
# Close the device and destroy the device handle
device.close()
device.destroy()