fpgaconvnet-tutorial icon indicating copy to clipboard operation
fpgaconvnet-tutorial copied to clipboard

Failed to run the sample

Open StreamBuns opened this issue 1 year ago • 0 comments

net.load_network("outputs/single_layer_opt.json")ERROR

# load the optimised network
net.load_network("outputs/single_layer_opt.json") # TODO: change name
net.update_partitions()

# print the performance and resource predictions
print(f"predicted latency (us): {net.get_latency()*1000000}")
print(f"predicted throughput (img/s): {net.get_throughput()} (batch size={net.batch_size})")
print(f"predicted resource usage: {net.partitions[0].get_resource_usage()}")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[2], line 2
      1 # load the optimised network
----> 2 net.load_network("outputs/single_layer_opt.json") # TODO: change name
      3 net.update_partitions()
      5 # print the performance and resource predictions

File ~\AppData\Roaming\Python\Python38\site-packages\fpgaconvnet\models\network\Network.py:274, in Network.load_network(self, network_path)
    271 for layer in partition.layers:
    272     # get layer type and hardware
    273     layer_type = fpgaconvnet.tools.layer_enum.from_proto_layer_type(layer.type)
--> 274     layer_hw = self.get_layer_hardware(layer)
    275     # add layer
    276     graph.add_node( layer.name, type=layer_type, hw=layer_hw, inputs={} )

File ~\AppData\Roaming\Python\Python38\site-packages\fpgaconvnet\models\network\Network.py:193, in Network.get_layer_hardware(self, layer_proto)
    191 # Convolution layer
    192 if layer_type == LAYER_TYPE.Convolution:
--> 193     return ConvolutionLayer(
    194         layer_proto.parameters.channels_out,
    195         layer_proto.parameters.rows_in,
    196         layer_proto.parameters.cols_in,
    197         layer_proto.parameters.channels_in,
    198         kernel_size =list(layer_proto.parameters.kernel_size),
    199         stride      =list(layer_proto.parameters.stride),
    200         pad         = [
    201             layer_proto.parameters.pad_top,
    202             layer_proto.parameters.pad_right,
    203             layer_proto.parameters.pad_bottom,
    204             layer_proto.parameters.pad_left],
    205         groups      =layer_proto.parameters.groups,
    206         fine        =layer_proto.parameters.fine,
    207         coarse_in   =layer_proto.parameters.coarse_in,
    208         coarse_out  =layer_proto.parameters.coarse_out
    209     )
    211 # Inner Product Layer
    212 if layer_type == LAYER_TYPE.InnerProduct:

TypeError: 'module' object is not callable

I began to think that the ConvolutionLayer initialization failed, and the initialization function I added to it still failed

StreamBuns avatar Nov 02 '23 12:11 StreamBuns