Coder Social home page Coder Social logo

magnet's People

Contributors

robgon-art avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

magnet's Issues

Issue running the "Initialize System" code in Colab

Hi, been trying to run your code in Colab and get this error (or both local and hosted backend):

Collecting` ftfy
  Downloading ftfy-6.0.3.tar.gz (64 kB)
Collecting regex
  Downloading regex-2021.8.28-cp39-cp39-win_amd64.whl (271 kB)
Requirement already satisfied: tqdm in c:\python\python39\lib\site-packages (4.60.0)
Requirement already satisfied: wcwidth in c:\python\python39\lib\site-packages (from ftfy) (0.2.5)
Using legacy 'setup.py install' for ftfy, since package 'wheel' is not installed.
Installing collected packages: regex, ftfy
    Running setup.py install for ftfy: started
    Running setup.py install for ftfy: finished with status 'done'
Successfully installed ftfy-6.0.3 regex-2021.8.28
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'c:\python\python39\python.exe -m pip install --upgrade pip' command.
  Running command git clone -q https://github.com/openai/CLIP.git 'C:\Users\vladi\AppData\Local\Temp\pip-req-build-ynvaumbq'
WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via the 'c:\python\python39\python.exe -m pip install --upgrade pip' command.
Collecting git+https://github.com/openai/CLIP.git
  Cloning https://github.com/openai/CLIP.git to c:\users\vladi\appdata\local\temp\pip-req-build-ynvaumbq
  Resolved https://github.com/openai/CLIP.git to commit 3b473b0e682c091a9e53623eebc1ca1657385717
Requirement already satisfied: ftfy in c:\python\python39\lib\site-packages (from clip==1.0) (6.0.3)
Requirement already satisfied: regex in c:\python\python39\lib\site-packages (from clip==1.0) (2021.8.28)
Requirement already satisfied: tqdm in c:\python\python39\lib\site-packages (from clip==1.0) (4.60.0)
Requirement already satisfied: torch in c:\python\python39\lib\site-packages (from clip==1.0) (1.9.0)
Collecting torchvision
  Downloading torchvision-0.10.0-cp39-cp39-win_amd64.whl (920 kB)
Requirement already satisfied: wcwidth in c:\python\python39\lib\site-packages (from ftfy->clip==1.0) (0.2.5)
Requirement already satisfied: typing-extensions in c:\python\python39\lib\site-packages (from torch->clip==1.0) (3.10.0.2)
Requirement already satisfied: numpy in c:\python\python39\lib\site-packages (from torchvision->clip==1.0) (1.20.2)
Requirement already satisfied: pillow>=5.3.0 in c:\python\python39\lib\site-packages (from torchvision->clip==1.0) (8.2.0)
Using legacy 'setup.py install' for clip, since package 'wheel' is not installed.
Installing collected packages: torchvision, clip
    Running setup.py install for clip: started
    Running setup.py install for clip: finished with status 'done'
Successfully installed clip-1.0 torchvision-0.10.0
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_76608/3415941945.py in <module>
      7 def print_allocated_gpu_memory():
      8   print(round(torch.cuda.memory_stats(device="cuda")["active_bytes.all.current"]/(1024.0*1024.0*1024.0),3), "gigs")
----> 9 print_allocated_gpu_memory()
     10 import clip
     11 from PIL import Image

~\AppData\Local\Temp/ipykernel_76608/3415941945.py in print_allocated_gpu_memory()
      6 warnings.filterwarnings('ignore')
      7 def print_allocated_gpu_memory():
----> 8   print(round(torch.cuda.memory_stats(device="cuda")["active_bytes.all.current"]/(1024.0*1024.0*1024.0),3), "gigs")
      9 print_allocated_gpu_memory()
     10 import clip

KeyError: 'active_bytes.all.current'

Mismatching CLIP model?

Hi, ran into an issue with running 5_MAGnet_Generate_Modern_Paintings.ipynb
Exact problem is this:

import clip
from PIL import Image
device = "cpu"
model, preprocess = clip.load("ViT-B/32", device=device)
...
input_resolution = model.input_resolution.item()

which produces this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib64/python3.7/site-packages/torch/nn/modules/module.py", line 1131, in __getattr__
    type(self).__name__, name))
AttributeError: 'CLIP' object has no attribute 'input_resolution'

So seem like current CLIP implementation that was pulled from GitHub doesn't have input_resolution method, and it's not entirely clear what substitute to use. I tried a (512, 512) touple along with just 512 integer and it doesn't seem to work.

Could you please help me out on this one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.