Comments (14)
Ok, I see.
Try this to use GPU 1
export CUDA_VISIBLE_DEVICES=1
python gradio_app.py
from draggan.
from draggan.
It is not necessary. You have to click two points at least. Blue: handle point, Red: target point, like this.
![image](https://private-user-images.githubusercontent.com/26198430/239740603-b54f56dd-cb12-4fbb-83b2-492096bb1a51.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwOTA5MDUsIm5iZiI6MTcxOTA5MDYwNSwicGF0aCI6Ii8yNjE5ODQzMC8yMzk3NDA2MDMtYjU0ZjU2ZGQtY2IxMi00ZmJiLTgzYjItNDkyMDk2YmIxYTUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIyVDIxMTAwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThhYmViNTZhMTUxNmViYzRiZWZlZjhjNGM2MDE3NTgyMTEzZDI5MGRjZWQyNGJjZDMyYTJmZDU4YTYyMTQ0NjYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3RAjGs345I5lTBWBHG7nXykLLlq5Xm5Gx07nJxfvHH4)
Then click drag it, the model would drag blue point towards red point.
BTW: Do you have any suggestion on some better error message ? Does handle point confuse you ?
from draggan.
File "/home/amax/euan/code/draggan/drag_gan.py", line 173, in drag_gan
F0 = F.detach().clone()
RuntimeError: CUDA out of memory. Tried to allocate 512.00 MiB (GPU 0; 23.69 GiB total capacity; 4.47 GiB already allocated; 150.94 MiB free; 4.99 GiB reserved in total by PyTorch)
I think maybe it's out of memory. lol~
how can i deploy it on my server. I have four 3090 gpus.
from draggan.
It can be deployed with about 9 GB GPU memory.
from draggan.
still got error. lol.
i think it's out of memory now
Traceback (most recent call last):
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/gradio/routes.py", line 421, in run_predict
event_data=event_data,
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/gradio/blocks.py", line 1321, in process_api
fn_index, inputs, iterator, request, event_id, event_data
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/gradio/blocks.py", line 1064, in call_function
prediction = await utils.async_iteration(iterator)
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/gradio/utils.py", line 514, in async_iteration
return await iterator.anext()
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/gradio/utils.py", line 508, in anext
run_sync_iterator_async, self.iterator, limiter=self.limiter
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/anyio/to_thread.py", line 32, in run_sync
func, *args, cancellable=cancellable, limiter=limiter
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread return await future
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/gradio/utils.py", line 490, in run_sync_iterator_async
return next(iterator)
File "gradio_app.py", line 103, in on_drag
max_iters=max_iters):
File "/home/amax/euan/code/draggan/drag_gan.py", line 182, in drag_gan
sample2, F2 = g_ema.generate(latent, noise)
File "/home/amax/euan/code/draggan/drag_gan.py", line 107, in generate
out = conv1(out, latent[:, i], noise=noise1)
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amax/euan/code/draggan/stylegan2/model.py", line 358, in forward
out = self.conv(input, style)
File "/home/amax/miniconda3/envs/cyy/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/amax/euan/code/draggan/stylegan2/model.py", line 275, in forward
input, weight, padding=0, stride=2, groups=batch
File "/home/amax/euan/code/draggan/stylegan2/op/conv2d_gradfix.py", line 64, in conv_transpose2d
).apply(input, weight, bias)
File "/home/amax/euan/code/draggan/stylegan2/op/conv2d_gradfix.py", line 146, in forward
**common_kwargs,
RuntimeError: CUDA out of memory. Tried to allocate 130.00 MiB (GPU 0; 23.69 GiB total capacity; 4.85 GiB already allocated; 120.94 MiB free; 5.02 GiB reserved in total by PyTorch)
from draggan.
Could you show the output of nvidia-smi
?
I think it might be lack of enough memory of your server
from draggan.
if __name__ == '__main__':
demo = main()
demo = demo.queue(concurrency_count=1, max_size=20).launch(share=True, server_name='10.xx.xx.239', port=6666)
i just modify the last line to deploy it on my own server which has 4x3090 gpus.
But it got into touble.
nvidia-smi
(cyy) amax@admin:~/euan/code/draggan$ nvidia-smi
Sun May 21 20:33:53 2023
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 525.105.17 Driver Version: 525.105.17 CUDA Version: 12.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... On | 00000000:18:00.0 Off | N/A |
| 39% 28C P8 19W / 350W | 17580MiB / 24576MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA GeForce ... On | 00000000:3B:00.0 Off | N/A |
| 39% 29C P8 26W / 350W | 2MiB / 24576MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 2 NVIDIA GeForce ... On | 00000000:86:00.0 Off | N/A |
| 42% 27C P8 23W / 350W | 2MiB / 24576MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 3 NVIDIA GeForce ... On | 00000000:AF:00.0 Off | N/A |
| 30% 28C P8 15W / 350W | 2MiB / 24576MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 4410 C python 8758MiB |
| 0 N/A N/A 18275 C python 8820MiB |
+-----------------------------------------------------------------------------+
from draggan.
I would like to ask, is this Gradio service running on a remote server or on a local PyTorch
from draggan.
I would like to ask, is this Gradio service running on a remote server or on a local PyTorch
Or to put it another way, Gradio service runs on the remote interface provided by Gradio, but the graphics card used is local
from draggan.
Well, I guess you want a shareable link? If it is, once you have launch the service via python gradio_app.py
. You will get a link similar as
Running on local URL: http://127.0.0.1:7860
Running on public URL: https://bf5e8576f09a6582f7.gradio.live
This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces
https://bf5e8576f09a6582f7.gradio.live
can be accessed anywhere and use your local GPU
from draggan.
it works now.!!!!!
Thank you!!!
My dear friends.
from draggan.
Cool, you are welcome
from draggan.
it 's now smile. LOL. Thank you my friend. I forget to switch my gpu.
from draggan.
Related Issues (20)
- 跑起来后点击图片没反应 HOT 7
- uploaded image was blurred
- 群二维码过期了 HOT 1
- For further information visit https://errors.pydantic.dev/2.1.2/v/missing HOT 8
- mask did not use?
- Error in Mask HOT 2
- 10249
- about license
- Gradio gets stuck in loop after clicking an image or button HOT 6
- No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8' HOT 1
- 无法成功修改自己的照片。
- 你们这个东西真的超级难用,不知道是个什么玩意儿 HOT 1
- update install.md to specifiy the tag ‘main' instead of default 'latest' or empty
- python -m draggon.web, when add point, it failed. HOT 2
- Can't apply checkpoint model - missing DLL "bias_act_plugin"- module not found
- AttributeError: 'dict' object has no attribute 'img_resolution' HOT 8
- 为什么最新版本去掉了自定义照片功能
- TypeError: Image.__init__() got an unexpected keyword argument 'source' HOT 1
- Clicking on any button would result in loading forever. HOT 1
- > when i run **python visualizer_drag_gradio.py**
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from draggan.