Info | Value |
---|---|
Package | mvnc |
Module | mvncapi |
Version | 1.0 |
See also | Graph Graph.DeallocateGraph() |
This function is used to create an instance of a Graph that represents a neural network, which can be used to infer results via methods Graph.LoadTensor() and Graph.GetResult().
dev.AllocateGraph(graphPath)
Parameter | Description |
---|---|
graphPath | A string that is the path to the graph file. The graph file must have been created with the NC SDK graph compiler. |
Returns an instance of a Graph object that is ready to use.
After the Graph that is created is no longer needed, Graph.DeallocateGraph() must be called to free the graph resources.
from mvnc import mvncapi as ncs
# Enumerate Devices
device_List = ncs.Enumerate()
# Initialize and open the first device
device = ncs.Device(device_List[0])
device.OpenDevice()
# Allocate a graph on the device by specifying the path to a graph file
graph = device.AllocateGraph("../networks/myNetwork/graph")
# Use graph here
# Deallocate the graph to free resources
graph.DeallocateGraph()
#close device