ksugar / samapi Goto Github PK
View Code? Open in Web Editor NEWSegment Anything Model API
License: BSD 3-Clause "New" or "Revised" License
Segment Anything Model API
License: BSD 3-Clause "New" or "Revised" License
Hello,
I'm encountering a CUDA Out of Memory (OOM) issue while attempting to allocate an additional 768.00 MiB for model inference, despite having a seemingly sufficient amount of free memory on my NVIDIA GeForce RTX 3060 (6 GB total capacity). The exact warning message is as follows:
UserWarning: cuda device found but got the error CUDA out of memory. Tried to allocate 768.00 MiB (GPU 0; 5.80 GiB total capacity; 1.95 GiB already allocated; 356.75 MiB free; 2.00 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF - using CPU for inference
This occurs when I launch my application with Uvicorn, involving model registrations that potentially lead to this memory allocation issue. My environment is set up with CUDA 11.7 and PyTorch compatible with this CUDA version, running in a Conda environment on Ubuntu.
Could you provide insights or suggestions on how to manage or mitigate this OOM issue? Are there recommended practices for memory management or configurations specific to PyTorch that I should consider to optimize GPU memory usage and avoid hitting this limit?
Thank you for your support.
Hi,
Would you consider adding SamAutomaticMaskGenerator
support? If so, what would be the best way to add it?
I think this would be a really nice addition, since it could then be incorporated into the QuPath SAM extension.
Ideally, the QuPath extension could use SamAutomaticMaskGenerator
both interactively and from a script because it doesn't inherently require user interaction, and it would be good if the various kwargs
could be supported as well.
From the QuPath side, I imagine that a user might call a script that looks like this:
SAMUtils.segmentEverything("vit-l", ['points_per_side': 32, 'pred_iou_thresh': 0.86])
which would operate on the current image, or even current annotation selected within an image if required.
With the help of QuPath's 'Run for project', it would be possible to generate an initial segmentation across large numbers of images quickly... and, from Groovy, filter out segmented objects with specific characteristics if needed (e.g. very high or low mean intensity values).
Hi @ksugar ,
thank you for making this tool available !
The installation went smoothly but after starting the app:
(samapi) C:\Users\guiet>uvicorn samapi.main:app
INFO: Started server process [43704]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
and setting the server url :
After enabling SAM ViT-H, I created my first rectangle and got an error
I tested RGB transmission image and fluorescence image, with the 3 different models...
Thank you for your help,
Cheers,
Romain
Hi @ksugar ,
With docker I created (16 days ago) a conda env (using a yml file) to create a samapi environment (see below )
DockerFile
FROM nvcr.io/nvidia/pytorch:23.07-py3
...
...
...
# install samapi
COPY conda_envs/env_samapi.yml /tmp/env_samapi.yml
RUN conda env update -n samapi -f /tmp/env_samapi.yml \
&& conda clean --all -f -y \
&& conda env export -n "biop"
env_samapi.yml
name: "samapi"
channels:
- conda-forge
- defaults
dependencies:
- python=3.11
- pip
- pip:
- git+https://github.com/ksugar/samapi.git
prefix: "/opt/conda/envs/samapi"
But now I get an error
...
=> ERROR [16/18] RUN conda env update -n samapi -f /tmp/env_samapi.yml && conda clean --all -f -y && conda env export -n "biop" 183.2s
------
> [16/18] RUN conda env update -n samapi -f /tmp/env_samapi.yml && conda clean --all -f -y && conda env export -n "biop":
1.667 Channels:
1.667 - conda-forge
1.667 - defaults
1.667 Platform: linux-64
1.667 Collecting package metadata (repodata.json): ...working... done
46.59 Solving environment: ...working... done
47.75
47.75 Downloading and Extracting Packages
53.45 Preparing transaction: ...working... done
53.66 Verifying transaction: ...working... done
54.83 Executing transaction: ...working... done
57.20 Installing pip dependencies: ...working... Pip subprocess error:
182.9 Running command git clone --filter=blob:none --quiet https://github.com/ksugar/samapi.git /tmp/pip-req-build-c_iehv3a
182.9 Running command git clone --filter=blob:none --quiet https://github.com/ksugar/MobileSAM.git /tmp/pip-install-52glofzl/mobile-sam_7aa91f777a704ab2840ce452a2a8d188
182.9 WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7f676c388850>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /packages/f4/74/1c0c87dcf7ee0d69d383448182ca8b675d230f7329411f88067cba874ecd/fastapi-0.96.1-py3-none-any.whl.metadata
182.9 ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11; 3.0.0 Requires-Python >=3.7, <=3.11
182.9 ERROR: Could not find a version that satisfies the requirement torchvision<0.15.0,>=0.14.1 (from samapi) (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3, 0.15.0, 0.15.1, 0.15.2)
182.9 ERROR: No matching distribution found for torchvision<0.15.0,>=0.14.1
182.9
182.9 Ran pip subprocess with arguments:
182.9 ['/opt/conda/envs/samapi/bin/python', '-m', 'pip', 'install', '-U', '-r', '/tmp/condaenv.gbpw91fb.requirements.txt', '--exists-action=b']
182.9 Pip subprocess output:
182.9 Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
182.9 Collecting git+https://github.com/ksugar/samapi.git (from -r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Cloning https://github.com/ksugar/samapi.git to ./pip-req-build-c_iehv3a
182.9 Resolved https://github.com/ksugar/samapi.git to commit 6be6c93d40fc30bdd6d5279c7945e1e8996324a6
182.9 Installing build dependencies: started
182.9 Installing build dependencies: finished with status 'done'
182.9 Getting requirements to build wheel: started
182.9 Getting requirements to build wheel: finished with status 'done'
182.9 Preparing metadata (pyproject.toml): started
182.9 Preparing metadata (pyproject.toml): finished with status 'done'
182.9 Collecting mobile_sam@ git+https://github.com/ksugar/MobileSAM.git (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Cloning https://github.com/ksugar/MobileSAM.git to ./pip-install-52glofzl/mobile-sam_7aa91f777a704ab2840ce452a2a8d188
182.9 Resolved https://github.com/ksugar/MobileSAM.git to commit 41ac534a20a4779fab4f8c84e158ca7c7b40ff26
182.9 Preparing metadata (setup.py): started
182.9 Preparing metadata (setup.py): finished with status 'done'
182.9 Collecting fastapi[all]<0.97.0,>=0.96.0 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Obtaining dependency information for fastapi[all]<0.97.0,>=0.96.0 from https://files.pythonhosted.org/packages/f4/74/1c0c87dcf7ee0d69d383448182ca8b675d230f7329411f88067cba874ecd/fastapi-0.96.1-py3-none-any.whl.metadata
182.9 Downloading fastapi-0.96.1-py3-none-any.whl.metadata (24 kB)
182.9 Collecting geojson<4.0.0,>=3.0.1 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Downloading geojson-3.0.1-py3-none-any.whl (15 kB)
182.9 Collecting numpy<2.0.0,>=1.23.5 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Obtaining dependency information for numpy<2.0.0,>=1.23.5 from https://files.pythonhosted.org/packages/32/6a/65dbc57a89078af9ff8bfcd4c0761a50172d90192eaeb1b6f56e5fbf1c3d/numpy-1.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
182.9 Downloading numpy-1.25.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.6 kB)
182.9 Collecting opencv-python<5.0.0.0,>=4.7.0.72 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Obtaining dependency information for opencv-python<5.0.0.0,>=4.7.0.72 from https://files.pythonhosted.org/packages/f5/d0/2e455d894ec0d6527e662ad55e70c04f421ad83a6fd0a54c3dd73c411282/opencv_python-4.8.0.76-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
182.9 Downloading opencv_python-4.8.0.76-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)
182.9 Collecting pillow<10.0.0,>=9.5.0 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Downloading Pillow-9.5.0-cp311-cp311-manylinux_2_28_x86_64.whl (3.4 MB)
182.9 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.4/3.4 MB 28.2 MB/s eta 0:00:00
182.9 Collecting scikit-image<0.22.0,>=0.21.0 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Obtaining dependency information for scikit-image<0.22.0,>=0.21.0 from https://files.pythonhosted.org/packages/22/c3/c5f3c351d6337a18d07c3fb04475626c106cd3dc3d59b85ec50d07656db0/scikit_image-0.21.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
182.9 Downloading scikit_image-0.21.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (14 kB)
182.9 Collecting shapely<3.0.0,>=2.0.1 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Downloading shapely-2.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.3 MB)
182.9 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 26.9 MB/s eta 0:00:00
182.9 Collecting timm<0.10.0,>=0.9.2 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Obtaining dependency information for timm<0.10.0,>=0.9.2 from https://files.pythonhosted.org/packages/7a/bd/2c56be7a3b5bc71cf85a405246b89d5359f942c9f7fb6db6306d9d056092/timm-0.9.7-py3-none-any.whl.metadata
182.9 Downloading timm-0.9.7-py3-none-any.whl.metadata (58 kB)
182.9 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 33.6 MB/s eta 0:00:00
182.9 Collecting torch<2.0.0,>=1.13.1 (from samapi==0.3.1->-r /tmp/condaenv.gbpw91fb.requirements.txt (line 1))
182.9 Downloading torch-1.13.1-cp311-cp311-manylinux1_x86_64.whl (887.4 MB)
182.9 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 887.4/887.4 MB 14.0 MB/s eta 0:00:00
182.9 INFO: pip is looking at multiple versions of samapi to determine which version is compatible with other requirements. This could take a while.
182.9
182.9 failed
182.9
182.9 CondaEnvException: Pip failed
I tried to modify to the version below (from the updated README)
name: "samapi"
channels:
- conda-forge
- defaults
dependencies:
- python=3.10
- cudatoolkit=11.7
- pip
- pip:
- git+https://github.com/ksugar/samapi.git
prefix: "/opt/conda/envs/samapi"
but still get an ERROR :
=> ERROR [16/18] RUN conda env update -n samapi -f /tmp/env_samapi.yml && conda clean --all -f -y && conda env export -n "biop" 118.5s
------
> [16/18] RUN conda env update -n samapi -f /tmp/env_samapi.yml && conda clean --all -f -y && conda env export -n "biop":
1.982 Channels:
1.982 - conda-forge
1.982 - defaults
1.982 Platform: linux-64
1.982 Collecting package metadata (repodata.json): ...working... done
51.91 Solving environment: ...working... done
53.11
53.11 Downloading and Extracting Packages
libsqlite-3.43.0 | 821 KB | | 0%
53.14 cxx-ng-13.1.0 | 3.7 MB | | 0%
53.14 s-6.4 | 860 KB | | 0%
53.14 ools-68.1.2 | 451 KB | | 0%
53.14 -3.10.12 | 24.4 MB | | 0%
53.14 1.0.8 | 484 KB | | 0%
libsqlite-3.43.0 | 821 KB | ########## | 100%
53.98 cxx-ng-13.1.0 | 3.7 MB | #########2 | 92%
54.04 s-6.4 | 860 KB | 1 | 2%
54.04 ools-68.1.2 | 451 KB | 3 | 4%
54.04 -3.10.12 | 24.4 MB | ##9 | 30%
54.05 1.0.8 | 484 KB | 3 | 3%
54.05 0.41.2 | 56 KB | ########## | 100%
57.39 cxx-ng-13.1.0 | 3.7 MB | ########## | 100%
57.39 p_mutex-4.5 | 23 KB | ######9 | 69%
57.45 ools-68.1.2 | 451 KB | ########## | 100%
57.45 -3.10.12 | 24.4 MB | #########3 | 94%
57.45 1.0.8 | 484 KB | ########## | 100%
57.45 l_linux-64-2.4 | 688 KB | 2 | 2%
57.45 -ng-13.1.0 | 758 KB | 2 | 2%
57.45 p_mutex-4.5 | 23 KB | ########## | 100%
57.52 .6 | 409 KB | ########## | 100%
57.52 l-3.1.2 | 2.5 MB | ########## | 100%
57.52 tificates-2023 | 146 KB | ########## | 100%
57.52 l_linux-64-2.4 | 688 KB | ########## | 100%
75.70 -ng-13.1.0 | 758 KB | ########## | 100%
75.70 s-6.4 | 860 KB | ########## | 100%
75.71
75.71
75.71
75.71 Preparing transaction: ...working... done
75.92 Verifying transaction: ...working... done
77.24 Executing transaction: ...working... By downloading and using the CUDA Toolkit conda packages, you accept the terms and conditions of the CUDA End User License Agreement (EULA): https://docs.nvidia.com/cuda/eula/index.html
79.84
79.84 done
79.91 Installing pip dependencies: ...working... Pip subprocess error:
96.66 Running command git clone --filter=blob:none --quiet https://github.com/ksugar/samapi.git /tmp/pip-req-build-zqqgui68
96.66 fatal: unable to access 'https://github.com/ksugar/samapi.git/': Could not resolve host: github.com
96.66 error: subprocess-exited-with-error
96.66
96.66 × git clone --filter=blob:none --quiet https://github.com/ksugar/samapi.git /tmp/pip-req-build-zqqgui68 did not run successfully.
96.66 │ exit code: 128
96.66 ╰─> See above for output.
96.66
96.66 note: This error originates from a subprocess, and is likely not a problem with pip.
96.66 error: subprocess-exited-with-error
96.66
96.66 × git clone --filter=blob:none --quiet https://github.com/ksugar/samapi.git /tmp/pip-req-build-zqqgui68 did not run successfully.
96.66 │ exit code: 128
96.66 ╰─> See above for output.
96.66
96.66 note: This error originates from a subprocess, and is likely not a problem with pip.
96.66
96.66 Ran pip subprocess with arguments:
96.66 ['/opt/conda/envs/samapi/bin/python', '-m', 'pip', 'install', '-U', '-r', '/tmp/condaenv.zcouky75.requirements.txt', '--exists-action=b']
96.66 Pip subprocess output:
96.66 Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
96.66 Collecting git+https://github.com/ksugar/samapi.git (from -r /tmp/condaenv.zcouky75.requirements.txt (line 1))
96.66 Cloning https://github.com/ksugar/samapi.git to ./pip-req-build-zqqgui68
96.66
96.66 failed
96.66
96.66 CondaEnvException: Pip failed
96.66
------
Dockerfile:95
--------------------
94 | COPY conda_envs/env_samapi.yml /tmp/env_samapi.yml
95 | >>> RUN conda env update -n samapi -f /tmp/env_samapi.yml \
96 | >>> && conda clean --all -f -y \
97 | >>> && conda env export -n "biop"
98 |
--------------------
ERROR: failed to solve: process "/bin/sh -c conda env update -n samapi -f /tmp/env_samapi.yml && conda clean --all -f -y && conda env export -n \"biop\"" did not complete successfully: exit code: 1
Could it be because of ab8845e ?
Thank you for your inputs,
Cheers,
R
Add support for CellViT.
I want to use the SAM on Qupath but don't have any GPU on my computer. Would it be possible to provide access to something similar to Cloud collab
MobileSAM is much faster than the original SAM, keeping the output quality.
https://github.com/ChaoningZhang/MobileSAM
Image Encoder | Original SAM | MobileSAM |
---|---|---|
Paramters | 611M | 5M |
Speed | 452ms | 8ms |
Mask Decoder | Original SAM | MobileSAM |
---|---|---|
Paramters | 3.876M | 3.876M |
Speed | 4ms | 4ms |
Whole Pipeline (Enc+Dec) | Original SAM | MobileSAM |
---|---|---|
Paramters | 615M | 9.66M |
Speed | 456ms | 12ms |
Add options for micro-sam fine-tuned models.
https://github.com/computational-cell-analytics/micro-sam/blob/master/doc/finetuned_models.md
Hello,
I used a server computer for using GPU which is separated from my Desktop.
So, I installed SAM into the server computer and ran the SAM via SLURM.
I tried to connect that node with my local Desktop via ssh, but it is not connected.
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started parent process [61240]
INFO: Started server process [61264]
INFO: Started server process [61263]
INFO: Waiting for application startup.
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Application startup complete
ssh -NL 8000:c0906a-s11:8000 -l "User"
channel 2: open failed: connect failed: Connection refused
I think it is a kind of problem with Uvicorn.
Do you have a solution for connecting the node with the local computer?
Hi,
I am on windows 10.
I set up a samapi enviroment with the following commands as per the guide
conda create -n samapi -y python=3.11
conda activate samapi
conda install -y cudatoolkit=11.8
I had issues downloading .whl file for CUDA via pip, so used the following for conda instead
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
This all installed fine. But now when i run
uvicorn samapi.main:app
I get the following error
Downloading: "https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth" to C:\Users\U062951/.cache\torch\hub\checkpoints\sam_vit_h_4b8939.pth
Traceback (most recent call last):
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 1348, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\http\client.py", line 1283, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\http\client.py", line 1329, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\http\client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\http\client.py", line 1038, in _send_output
self.send(msg)
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\http\client.py", line 976, in send
self.connect()
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\http\client.py", line 1455, in connect
self.sock = self._context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\ssl.py", line 517, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\ssl.py", line 1075, in _create
self.do_handshake()
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\ssl.py", line 1346, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1002)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\U062951\Miniconda3\envs\samapi\Scripts\uvicorn.exe\__main__.py", line 7, in <module>
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\click\core.py", line 1130, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\uvicorn\main.py", line 410, in main
run(
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\uvicorn\main.py", line 578, in run
server.run()
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\uvicorn\config.py", line 473, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\samapi\main.py", line 26, in <module>
ModelType.vit_h: load_state_dict_from_url(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\torch\hub.py", line 746, in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\site-packages\torch\hub.py", line 611, in download_url_to_file
u = urlopen(req)
^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 216, in urlopen
return opener.open(url, data, timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 519, in open
response = self._open(req, data)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 536, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 496, in _call_chain
result = func(*args)
^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 1391, in https_open
return self.do_open(http.client.HTTPSConnection, req,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\U062951\Miniconda3\envs\samapi\Lib\urllib\request.py", line 1351, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1002)>
Coud you please advise what might be the issue or how to fix?
Thanks!
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.