GithubHelp home page GithubHelp logo

Comments (10)

ouyangjiacs avatar ouyangjiacs commented on August 27, 2024 2

Thank you very much, it has been resolved so far.

If others encounter the same problem as me, need to download it
vgg16-397923af( https://download.pytorch.org/models/vgg16-397923af.pth )to /root/.cache/torch/hub/checkpoints/vgg16-397923af.pth,
vgg.pth( https://heibox.uni-heidelberg.de/f/607503859c864bc1b30b/?dl=1 ),
checkpoint_ liberty_ with_ aug.pth
(https://github.com/DagnyT/hardnet/raw/master/pretrained/train_liberty_with_aug/checkpoint_liberty_with_aug.pth ) to /root/.cache/torch/hub/checkpoints/checkpoint_ liberty_ with_ Aug.pth,
open_clip still needs to be modified_ The 113 line code logic of clip/factory. py prevents online downloads.

from stablesr.

ouyangjiacs avatar ouyangjiacs commented on August 27, 2024 2

oh, yes, I have download the models--laion--CLIP-ViT-H-14-laion2B-s32B-b79K(open_clip_pytorch_model.bin)to the data/work/StableSR-main,and change the /opt/conda/lib/python3.8/site-packages/open_clip/factory.py 113line code:
if True:
print(">>>>>>>>>>>>>> model_name[{}] pretrained[{}]".format(model_name, pretrained))
checkpoint_path = "/data/work/StableSR-main/models--laion--CLIP-ViT-H-14-laion2B-s32B-b79K/snapshots/94a64189c3535c1cb44acfcccd7b0908c1c8eb23/open_clip_pytorch_model.bin"
if False:
if pretrained_cfg:
checkpoint_path = download_pretrained(pretrained_cfg, cache_dir=cache_dir)
elif os.path.exists(pretrained):
checkpoint_path = pretrained

from stablesr.

ouyangjiacs avatar ouyangjiacs commented on August 27, 2024

Thank you very much for the author's work.

The main issue is that I can only install the environment offline, which is very painful. I hope to quickly configure the environment to replicate the author's work.

from stablesr.

ouyangjiacs avatar ouyangjiacs commented on August 27, 2024

Where to place the offline downloaded model so that the code does not download the model online.

from stablesr.

ouyangjiacs avatar ouyangjiacs commented on August 27, 2024

Loading model from /data/work/StableSR-main/model/stablesr_000117.ckpt
Global Step: 16500
LatentDiffusionSRTextWT: Running in eps-prediction mode
DiffusionWrapper has 918.93 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 64, 64) = 16384 dimensions.
making attention of type 'vanilla' with 512 in_channels
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 700, in urlopen
self._prepare_proxy(conn)
File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 994, in prepare_proxy
conn.connect()
File "/usr/local/lib/python3.8/dist-packages/urllib3/connection.py", line 416, in connect
self.sock = ssl_wrap_socket(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl
.py", line 449, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/ssl
.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/usr/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/usr/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 486, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/dist-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /laion/CLIP-ViT-H-14-laion2B-s32B-b79K/resolve/main/open_clip_pytorch_model.bin (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas.py", line 430, in
main()
File "scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas.py", line 273, in main
model = load_model_from_config(config, f"{opt.ckpt}")
File "scripts/sr_val_ddpm_text_T_vqganfin_oldcanvas.py", line 120, in load_model_from_config
model = instantiate_from_config(config.model)
File "/data/work/StableSR-main/ldm/util.py", line 85, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "/data/work/StableSR-main/ldm/models/diffusion/ddpm.py", line 1597, in init
self.instantiate_cond_stage(cond_stage_config)
File "/data/work/StableSR-main/ldm/models/diffusion/ddpm.py", line 1710, in instantiate_cond_stage
model = instantiate_from_config(config)
File "/data/work/StableSR-main/ldm/util.py", line 85, in instantiate_from_config
return get_obj_from_str(config["target"])(**config.get("params", dict()))
File "/data/work/StableSR-main/ldm/modules/encoders/modules.py", line 153, in init
model, _, _ = open_clip.create_model_and_transforms(arch, device=torch.device('cpu'), pretrained=version)
File "/usr/local/lib/python3.8/dist-packages/open_clip/factory.py", line 151, in create_model_and_transforms
model = create_model(
File "/usr/local/lib/python3.8/dist-packages/open_clip/factory.py", line 113, in create_model
checkpoint_path = download_pretrained(pretrained_cfg, cache_dir=cache_dir)
File "/usr/local/lib/python3.8/dist-packages/open_clip/pretrained.py", line 295, in download_pretrained
target = download_pretrained_from_hf(model_id, cache_dir=cache_dir)
File "/usr/local/lib/python3.8/dist-packages/open_clip/pretrained.py", line 265, in download_pretrained_from_hf
cached_file = hf_hub_download(model_id, filename, revision=revision, cache_dir=cache_dir)
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 1195, in hf_hub_download
metadata = get_hf_file_metadata(
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_validators.py", line 120, in _inner_fn
return fn(*args, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 1532, in get_hf_file_metadata
r = _request_wrapper(
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 407, in _request_wrapper
response = _request_wrapper(
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/file_download.py", line 442, in _request_wrapper
return http_backoff(
File "/usr/local/lib/python3.8/dist-packages/huggingface_hub/utils/_http.py", line 212, in http_backoff
response = session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 587, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 701, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /laion/CLIP-ViT-H-14-laion2B-s32B-b79K/resolve/main/open_clip_pytorch_model.bin (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')))

from stablesr.

IceClear avatar IceClear commented on August 27, 2024

Hi.
Sry that I am not sure about that.
In theory, our model does not rely on additional models.
However, our code is based on LDM and Stable diffusion. The download process should be inside the code which may need much time to verify.
I am now busy with other works so I am sorry I may not be able to solve it now.
You can check the code and try to fix this for offline installation.
Currently, it seems that the downloading process is from open_clip, a package used by LDM.
You may have a check.

from stablesr.

tvaranka avatar tvaranka commented on August 27, 2024

What works for me with the SSL errors is the following:

  1. Use python 3.9 or higher
  2. Downgrade requests to 2.27.1
  3. Add the following on top of the main file
import os
os.environ['CURL_CA_BUNDLE'] = ''

from stablesr.

YangGangZhiQi avatar YangGangZhiQi commented on August 27, 2024

@ouyangjiacs Hi, I have encountered the same problems like you. How did you solve the problem?
Did you download the open_clip_pytorch_model.bin? Or we just do not need download open_clip_pytorch_model.bin and prevents online downloads?

open_clip still needs to be modified_ The 113 line code logic of clip/factory. py prevents online downloads.

from stablesr.

YangGangZhiQi avatar YangGangZhiQi commented on August 27, 2024

@ouyangjiacs Good idea! I will try it. Thanks for your quick answer.

from stablesr.

ouyangjiacs avatar ouyangjiacs commented on August 27, 2024

you are welcome.
I hope it can help you

from stablesr.

Related Issues (20)

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.