Coder Social home page Coder Social logo

slooi / imageai-setup-guide Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 20.0 23 KB

This is a step-by-step guide on how to set up ImageAI using Google's free service, Google Collab

License: BSD 3-Clause "New" or "Revised" License

Jupyter Notebook 100.00%
colab-notebook ipynb tutorial

imageai-setup-guide's Introduction

ImageAI-Setup-Guide

This is a visual, step-by-step guide on how to set up ImageAI using Google's free service, Google Collab. This guide hopes to lower the barrier of entry and further democratise this technology for the general public.

Step 1: Go to Google Collab (https://colab.research.google.com/)

  • You'll have to set up a Google account if you haven't already

Step 2: Create a new notebook using this github

  1. Within Google Collab, navigate to the 'Github' tab
  2. Paste the following url into the text field:

https://github.com/slooi/ImageAI-Setup-Guide/blob/main/ImageAISetup.ipynb

  1. Then press your enter key
  2. Click on the newly appeared 'ImageAISetup.ipynb'
newNotebook.mp4

Step 3: Enable GPU

  1. Navigate to the 'Edit' button located at the top-left
  2. Then select 'Notebook settings'
  3. Under 'Hardware accelerator', select the 'GPU' option
  4. Click 'Save'
gpu.mp4

Step 4: Download Files

  1. Run the first block of code by clicking the play button located on the left side of the code block (note this step will take between 4-7 minutes. Try running the block of code again if it doesn't finish within that time frame)
  2. You will get a warning from google. Click 'Run anyway' to continue.

Step 5: Running ImageAI

  1. Run the second block of code

  1. After waiting for 1-2 minutes, a link ending with .trycloudflare.com should appear. Click it to navigate to your own instance of ImageAI

Step 6: Have Fun!

Gotchas

  • You should be able to generate 50+ images before reaching the limit of the free tier. Wait 1-3 days for it to reset.

Credits

This guide is a streamlined version of https://github.com/JingShing/ImageAI-colab-ver

Huge thanks to: JingShing, Anonymous, 炼铜术士, 神楽坂早苗️, Jonathan, 咕 咕, 猫又逆变器, Gaein nidb

imageai-setup-guide's People

Contributors

slooi 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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

imageai-setup-guide's Issues

Can't run the set up

Hi, I don't really understand these computer stuff since I'm just an artist that use this set up as reference for the art I'm making. I for somereason can't run the set up? I've followed your guide set up and has been doing so for the past couple of months, but it stopped working since around a couple of days ago. I hope you can help me figure out what i did wrong and run it again :(( ty

Question

Hey,

In case the new API novel ai version stops to work, can you tell me what file, or code to edit to make it work again so that I can upload it myself?

Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared

2023-02-23T16:18:45Z WRN The user running cloudflared process has a GID (group ID) that is not within ping_group_range. You might need to add that user to a group within that range, or instead update the range to encompass a group the user is already in by modifying /proc/sys/net/ipv4/ping_group_range. Otherwise cloudflared will not be able to ping this network error="Group ID 0 is not between ping group 1 to 0"
2023-02-23T16:18:45Z WRN ICMP proxy feature is disabled error="cannot create ICMPv4 proxy: Group ID 0 is not between ping group 1 to 0 nor ICMPv6 proxy: socket: permission denied"
2023-02-23T16:18:45Z INF Starting metrics server on 127.0.0.1:42427/metrics
2023/02/23 16:18:45 failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB). See https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size for details.
2023-02-23T16:18:46Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:46Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:46Z INF Retrying connection in up to 2s connIndex=0 ip=198.41.192.7
2023-02-23T16:18:47Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:47Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:47Z INF Retrying connection in up to 4s connIndex=0 ip=198.41.192.7
2023-02-23T16:18:47Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:47Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:47Z INF Retrying connection in up to 8s connIndex=0 ip=198.41.192.7
2023-02-23T16:18:52Z ERR Failed to serve quic connection error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:52Z ERR Register tunnel error from server side error="Unauthorized: Failed to get tunnel" connIndex=0 ip=198.41.192.7
2023-02-23T16:18:52Z INF Retrying connection in up to 16s connIndex=0 ip=198.41.192.7
2023-02-23T16:19:05Z INF Connection e1ab62e0-cb54-422e-a7a6-463132e5de23 registered with protocol: quic connIndex=0 ip=198.41.192.7 location=IAD
2023-02-23T16:19:05Z INF Connection af9f5306-9152-4797-928a-407e2f70535a registered with protocol: quic connIndex=1 ip=198.41.200.23 location=ORD
2023-02-23T16:19:06Z INF Connection 1b59f7dc-159d-422b-97c9-d30dc3b635c6 registered with protocol: quic connIndex=2 ip=198.41.200.43 location=ORD
2023-02-23T16:19:07Z INF Connection e4ec800f-7682-4d30-8468-55424bb0ad08 registered with protocol: quic connIndex=3 ip=198.41.192.27 location=IAD
2023-02-23T16:19:50Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" cfRay=79e1490d747aee5a-IAD originService=http://localhost:6969/
2023-02-23T16:19:50Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" connIndex=0 dest=https://summary-protection-genuine-venice.trycloudflare.com/ ip=198.41.192.7 type=http
2023-02-23T16:19:50Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" cfRay=79e1491005caee5a-IAD originService=http://localhost:6969/
2023-02-23T16:19:50Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" connIndex=0 dest=https://summary-protection-genuine-venice.trycloudflare.com/favicon.ico ip=198.41.192.7 type=http
2023-02-23T16:23:01.308213Z INFO proxy{id=16900ab0-555e-4fcb-90c8-68415947d19b}: bore_cli::client: new connection
2023-02-23T16:23:01.329833Z WARN proxy{id=16900ab0-555e-4fcb-90c8-68415947d19b}: bore_cli::client: connection exited with error err=could not connect to localhost:6969
2023-02-23T16:24:33Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" cfRay=79e14ff610e5ee5a-IAD originService=http://localhost:6969/
2023-02-23T16:24:33Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" connIndex=0 dest=https://summary-protection-genuine-venice.trycloudflare.com/ ip=198.41.192.7 type=http
2023-02-23T16:24:33Z ERR error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" cfRay=79e14ff8c24dee5a-IAD originService=http://localhost:6969/
2023-02-23T16:24:33Z ERR Request failed error="Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared: dial tcp 127.0.0.1:6969: connect: connection refused" connIndex=0 dest=https://summary-protection-genuine-venice.trycloudflare.com/favicon.ico ip=198.41.192.7 type=http

Does it work now?

It was was working before and it's server just says 503. Any idea dev? Help

ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports'

Traceback (most recent call last):
File "/content/naifu/hydra_node/config.py", line 162, in init_config_model
model = no_init(lambda: model_mapconfig.model_name)
File "/content/naifu/hydra_node/config.py", line 34, in no_init
result = loading_code()
File "/content/naifu/hydra_node/config.py", line 162, in
model = no_init(lambda: model_mapconfig.model_name)
File "/content/naifu/hydra_node/models.py", line 200, in init
model, model_config = self.from_folder(config.model_path)
File "/content/naifu/hydra_node/models.py", line 296, in from_folder
model = self.load_model_from_config(model_config, model_path)
File "/content/naifu/hydra_node/models.py", line 315, in load_model_from_config
model = instantiate_from_config(config.model)
File "/content/naifu/ldm/util.py", line 79, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "/content/naifu/ldm/util.py", line 87, in get_obj_from_str
return getattr(importlib.import_module(module, package=None), cls)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/content/naifu/ldm/models/diffusion/ddpm.py", line 12, in
import pytorch_lightning as pl
File "/content/naifu/venv/lib/python3.10/site-packages/pytorch_lightning/init.py", line 34, in
from pytorch_lightning.callbacks import Callback # noqa: E402
File "/content/naifu/venv/lib/python3.10/site-packages/pytorch_lightning/callbacks/init.py", line 25, in
from pytorch_lightning.callbacks.progress import ProgressBarBase, RichProgressBar, TQDMProgressBar
File "/content/naifu/venv/lib/python3.10/site-packages/pytorch_lightning/callbacks/progress/init.py", line 22, in
from pytorch_lightning.callbacks.progress.rich_progress import RichProgressBar # noqa: F401
File "/content/naifu/venv/lib/python3.10/site-packages/pytorch_lightning/callbacks/progress/rich_progress.py", line 20, in
from torchmetrics.utilities.imports import _compare_version
ImportError: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/content/naifu/venv/lib/python3.10/site-packages/torchmetrics/utilities/imports.py)
2023-07-09 05:12:27,004 ERROR config.py(3007) - Failed to load model: cannot import name '_compare_version' from 'torchmetrics.utilities.imports' (/content/naifu/venv/lib/python3.10/site-packages/torchmetrics/utilities/imports.py)

`Cannot import name 'rank_zero_only'` and 502 error

I followed the instructions in the README on Google Colab, and when running the server, the following error raised:

ImportError: cannot import name 'rank_zero_only' from 'pytorch_lightning.utilities.distributed' (/content/naifu/venv/lib/python3.7/site-packages/pytorch_lightning/utilities/distributed.py)

And when accessing the web page, the following was displayed:

502 Bad Gateway
Unable to reach the origin service. The service may be down or it may not be responding to traffic from cloudflared

Could not connect to localhost:6969

Installed this morning with no problems. I used it for a few hours and the script stopped working. Is it because of the limit?

INFO proxy{id=47ac5018-e3f1-4d9f-b16a-b162caa08c21}: bore_cli::client: new connection
WARN proxy{id=47ac5018-e3f1-4d9f-b16a-b162caa08c21}: bore_cli::client: connection exited with error err=could not connect to localhost:6969

Can i run it locally or in a platform with no limitations?

im new to this image AI with the colab and since you can't use the colab everytime you want it ( if you dont pay) i wanted to know if possilble how to run it locally, im a noob soo.. i installed jupyter notebook and connected it with colab (idk if thats a good way to do it) and when i tried to run it some commands didnt get recognized. I saw other "issues" but i got overwelmed with the amount of comments (i read them but didnt really understand some, but i think somoene got a way to run it locally )

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.