chn-lee-yumi / MaterialSearch

AI语义搜索本地素材。以图搜图、查找本地素材、根据文字描述匹配画面、视频帧搜索、根据画面描述搜索视频。Semantic search. Search local photos and videos through natural language.
GNU General Public License v3.0
863 stars 117 forks source link

CPU版本可以正常启动 cuda版本无法启动 #110

Closed zuiaiyutu closed 2 months ago

zuiaiyutu commented 2 months ago

不管是下载的一键包,还是我自己用conda部署的,都无法启动cuda版本,会报错 安装gpu 运行报错

(D:\AI\MaterialSearch) PS C:\Users\Administrator> cd d:\ai\MaterialSearch\ (D:\AI\MaterialSearch) PS D:\AI\MaterialSearch> .\run.bat

D:\AI\MaterialSearch>python main.py ** 运行配置 / RUNNING CONFIGURATIONS ** HOST: '0.0.0.0' PORT: 8085 ASSETS_PATH: ('C:\Users\Administrator\Pictures', 'C:\Users\Administrator\Videos') SKIP_PATH: ('/tmp',) IMAGE_EXTENSIONS: ('.jpg', '.jpeg', '.png', '.gif', '.heic', '.webp', '.bmp') VIDEO_EXTENSIONS: ('.mp4', '.flv', '.mov', '.mkv', '.webm', '.avi') IGNORE_STRINGS: ('thumb', 'avatar', '__macosx', 'icons', 'cache') FRAME_INTERVAL: 2 SCAN_PROCESS_BATCH_SIZE: 8 IMAGE_MIN_WIDTH: 64 IMAGE_MIN_HEIGHT: 64 AUTO_SCAN_START_TIME: (22, 30) AUTO_SCAN_END_TIME: (8, 0) AUTO_SAVE_INTERVAL: 100 MODEL_NAME: 'OFA-Sys/chinese-clip-vit-base-patch16' DEVICE: 'cuda' CACHE_SIZE: 64 POSITIVE_THRESHOLD: 36 NEGATIVE_THRESHOLD: 36 IMAGE_THRESHOLD: 85 LOG_LEVEL: 'INFO' SQLALCHEMY_DATABASE_URL: 'sqlite:///./instance/assets.db' TEMP_PATH: './tmp' VIDEO_EXTENSION_LENGTH: 0 ENABLE_LOGIN: False USERNAME: 'Administrator' PASSWORD: 'MaterialSearch' FLASK_DEBUG: False HF_HOME: huggingface HF_HUB_OFFLINE: 1 TRANSFORMERS_OFFLINE: 1 CWD: D:\AI\MaterialSearch


Traceback (most recent call last): File "D:\AI\MaterialSearch\main.py", line 13, in from process_assets import match_text_and_image, process_image, process_text File "D:\AI\MaterialSearch\process_assets.py", line 9, in import torch File "D:\AI\MaterialSearch\lib\site-packages\torch__init__.py", line 148, in raise err OSError: [WinError 126] 找不到指定的模块。 Error loading "D:\AI\MaterialSearch\lib\site-packages\torch\lib\fbgemm.dll" or one of its dependencies.

chn-lee-yumi commented 2 months ago

可以参考: https://github.com/pytorch/pytorch/issues/129568 或者: https://www.bing.com/search?q=pytorch+Error+loading+%22fbgemm.dll%22&qs=n&form=QBRE&sp=-1&lq=0&pq=pytorch+error+loading+%22fbgemm.dll

chn-lee-yumi commented 2 months ago

torch 2.4 有问题,需要安装<2.4的版本。CUDA的安装脚本忘记指定版本了,现在已经更新。可以用下面的命令指定版本:

pip install -U torch<2.4 --index-url=https://download.pytorch.org/whl/cu118