-
Notifications
You must be signed in to change notification settings - Fork 89
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
AttributeError: 'int' object has no attribute 'dtype' #97
Comments
Hi @mat10599, I was not able to replicate your issue ... so this likely means this is an environmental issue: Here's my environment: $ pip show ai-edge-model-explorer
Name: ai-edge-model-explorer
Version: 0.1.7
Summary: A modern model graph visualizer and debugger
Home-page:
Author:
Author-email: Google LLC <[email protected]>
License:
Location: xxxxxxxx/envs/model-explorer/lib/python3.11/site-packages
Requires: ai-edge-model-explorer-adapter, flask, ipython, numpy, packaging, portpicker, requests, termcolor, torch, typing-extensions
Required-by:
$ pip show torch
Name: torch
Version: 2.3.1
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3
Location: xxxxxxxxx/envs/model-explorer/lib/python3.11/site-packages
Requires: filelock, fsspec, jinja2, networkx, sympy, typing-extensions
Required-by: ai-edge-model-explorer, open_clip_torch, timm, torchvision
$ pip show open_clip_torch
Name: open_clip_torch
Version: 2.26.1
Summary: Open reproduction of consastive language-image pretraining (CLIP) and related.
Home-page: https://github.com/mlfoundations/open_clip
Author: Gabriel Ilharco, Mitchell Wortsman, Romain Beaumont
Author-email: Ross Wightman <[email protected]>
License: MIT
Location: xxxxxxxx/envs/model-explorer/lib/python3.11/site-packages
Requires: ftfy, huggingface-hub, regex, timm, torch, torchvision, tqdm
Required-by: Here's the script I ran: import model_explorer
import open_clip
import torch
device = "cpu"
model,_, processor = open_clip.create_model_and_transforms(
model_name="coca_ViT-L-14",
pretrained="mscoco_finetuned_laion2B-s13B-b90k",
device=device)
inputs = (torch.rand([1, 3, 224, 224]),)
ep = torch.export.export(model.visual, inputs)
model_explorer.visualize_pytorch('visionnet', exported_program=ep,
port=8081) Here's how to recreate my conda environment: conda create -n model-explorer python=3.11
conda activate model-explorer
pip install ai-edge-model-explorer open_clip_torch While conda is not necessary, I do recommend you have a way of separating your environments/starting fresh ones. Is your environment similar? Are there any discrepancies you can see? Are you using a GPU/Cuda? Thanks. |
Hello, Thank you for your quick reply, The error happens both when I load the model on cuda and cpu. Here is what i get when i run pip show ai-edge-model-explorer
pip show torch
pip show open_clip_torch
I am using vertex ai workbench VMs and torch 2.2 (torch 2.3 is not available yet) is installed by default during VM creation. |
Hi @mat10599, do you have access to WSL or can you install/use WSL on your windows machine? Just to get more data... I will see if I can setup a vertex AI workbench to try. |
Ok I have setup a new vertex AI workbench... in a fairly standard configuration (I kept the jupyterlab3 image... did you?), It already has conda installed, so I just went to the terminal and did this: pip install ai-edge-model-explorer open_clip_torch This effectively installed torch 2.3.1 in my case.. how did you create your vertex AI workbench instance? |
I can free myself some time to try this over the weekend but visualisation is more a nice to have for me than a key component.
Regarding you second comment, when I create an environment, tensorflow/pytorch is pre-installed during vm creation and setup wrt the gpus. I have been advised to apply this method to avoid driver gpu issues. (see screenshot below for the pre-installed environment that are available, torch 2.2 is the latest) |
Ok, I'm guessing my account type is different so I have different options... do you know if you have a clean environment you can select? I'm thinking you can just do the installation steps on a cleaner environment so your software will use the right versions. Alternatively, have you just tried manually updating PyTorch? With GPU & conda: conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia or pip3 install torch torchvision torchaudio |
Marking this issue as stale since it has been open for 7 days with no activity. This issue will be closed if no further activity occurs. |
This issue was closed because it has been inactive for 14 days. Please post a new issue if you need further assistance. Thanks! |
Hello,
I am trying to run your graph visualization on the vision transformer from the CoCa model.
Here is the code I run and the full traceback I get.
Code
Traceback
Any help appreciated,
Thanks,
Mathieu
The text was updated successfully, but these errors were encountered: