Mr-TalhaIlyas/Tensorflow-Keras-Model-Profiler

seems to fail on the example from the README

Opened this issue · 0 comments

from tensorflow.keras.applications import VGG16

model = VGG16(include_top=True, weights="imagenet", input_tensor=None,
input_shape=None, pooling=None, classes=1000,
classifier_activation="softmax")

from model_profiler import model_profiler
Batch_size = 128
profile = model_profiler(model, Batch_size)
print(profile)


ValueError Traceback (most recent call last)
Cell In[8], line 9
7 from model_profiler import model_profiler
8 Batch_size = 128
----> 9 profile = model_profiler(model, Batch_size)
10 print(profile)

File ~/anaconda3/envs/chrombpnet/lib/python3.8/site-packages/model_profiler/profiler.py:72, in model_profiler(model, Batch_size, profile, use_units, verbose)
66 mem_req = mem_for_storing_weights(use_units[4], model)
68 values = [gpus, flops, mem, param, mem_req]
70 full_profile = np.concatenate((
71 np.asarray(Profile).reshape(-1,1),
---> 72 np.asarray(values).reshape(-1,1),
73 np.asarray(use_units).reshape(-1,1)
74 )
75 , 1)
76 profile = tabulate(
77 np.ndarray.tolist(full_profile),
78 headers = ["Model Profile", "Value", "Unit"],
79 tablefmt="github"
80 )
81 if verbose > 0:

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (5,) + inhomogeneous part.