robgon-art / magnet Goto Github PK
View Code? Open in Web Editor NEWModern Art Generator using Deep Neural Networks
License: Creative Commons Attribution Share Alike 4.0 International
Modern Art Generator using Deep Neural Networks
License: Creative Commons Attribution Share Alike 4.0 International
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'
Hi Robert,
Thanks for sharing your work, looks cool.
Can you share weights or model?
Thanks
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.