Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seems to fail on the example from the README #7

Open
mepster opened this issue Jan 27, 2024 · 0 comments
Open

seems to fail on the example from the README #7

mepster opened this issue Jan 27, 2024 · 0 comments

Comments

@mepster
Copy link

mepster commented Jan 27, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant