Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model scope's notebook not work #597

Closed
zhenhua22 opened this issue Aug 20, 2024 · 6 comments
Closed

model scope's notebook not work #597

zhenhua22 opened this issue Aug 20, 2024 · 6 comments

Comments

@zhenhua22
Copy link

when i run !python3 app.py in modelscope

it report me :
2024-08-20 22:25:36,056 - modelscope - WARNING - No preprocessor field found in cfg.
2024-08-20 22:25:36,056 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-08-20 22:25:36,056 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/mnt/workspace/.cache/modelscope/hub/damo/cv_resnet101_image-multiple-human-parsing'}. trying to build by task and model information.
2024-08-20 22:25:36,056 - modelscope - WARNING - No preprocessor key ('m2fp', 'image-segmentation') found in PREPROCESSOR_MAP, skip building preprocessor.
2024-08-20 22:25:36,731 - modelscope - INFO - Use user-specified model revision: v1.0.3
Downloading: 0.00B [00:00, ?B/s]
Traceback (most recent call last):
File "/mnt/workspace/facechain/app.py", line 574, in
gen_portrait = GenPortrait()
File "/mnt/workspace/facechain/facechain/inference_fact.py", line 297, in init
self.image_face_fusion = pipeline('face_fusion_torch',
File "/usr/local/lib/python3.10/site-packages/modelscope/pipelines/builder.py", line 118, in pipeline
model = normalize_model_input(
File "/usr/local/lib/python3.10/site-packages/modelscope/pipelines/builder.py", line 36, in normalize_model_input
model = snapshot_download(
File "/usr/local/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 84, in snapshot_download
return _snapshot_download(
File "/usr/local/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 241, in _snapshot_download
_download_file_lists(
File "/usr/local/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 416, in _download_file_lists
download_file(url, repo_file, temporary_cache_dir, cache, headers,
File "/usr/local/lib/python3.10/site-packages/modelscope/hub/file_download.py", line 606, in download_file
file_integrity_validation(temp_file, file_meta[FILE_HASH])
File "/usr/local/lib/python3.10/site-packages/modelscope/hub/utils/utils.py", line 88, in file_integrity_validation
file_sha256 = compute_hash(file_path)
File "/usr/local/lib/python3.10/site-packages/modelscope/hub/utils/utils.py", line 68, in compute_hash
with open(file_path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/workspace/.cache/modelscope/hub/._____temp/damo/cv_unet_face_fusion_torch/image_face_fusion/network/init.py'

@zhenhua22
Copy link
Author

so i can not runing this project ,please help me

@linxiaohui
Copy link

same problem

@linxiaohui
Copy link

linxiaohui commented Sep 9, 2024

It seems that the http_get_model_file function in file_download.py does not handle file of size 0 correctly.

the code

            if partial_length >= file_size:
                break
            # closed range[], from 0.
            get_headers['Range'] = 'bytes=%s-%s' % (partial_length,
                                                    file_size - 1)
            with open(temp_file_path, 'ab+') as f:
                r = requests.get(
                    url,

does not create file if the size is 0 (cv_unet_face_fusion_torch/image_face_fusion/network/__init__.py is the case)

a temporary workround is change the condition if partial_length >= file_size: to if file_size!=0 and partial_length >= file_size:

@You-Cun
Copy link
Collaborator

You-Cun commented Sep 24, 2024

Due to the update of the modelscope notebook, the original image has been removed from the options. We will adjust the code to adapt to the new image soon.

@zhangpanpan1
Copy link

when i run !python3 app.py in modelscope

it report me : 2024-08-20 22:25:36,056 - modelscope - WARNING - No preprocessor field found in cfg. 2024-08-20 22:25:36,056 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file. 2024-08-20 22:25:36,056 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/mnt/workspace/.cache/modelscope/hub/damo/cv_resnet101_image-multiple-human-parsing'}. trying to build by task and model information. 2024-08-20 22:25:36,056 - modelscope - WARNING - No preprocessor key ('m2fp', 'image-segmentation') found in PREPROCESSOR_MAP, skip building preprocessor. 2024-08-20 22:25:36,731 - modelscope - INFO - Use user-specified model revision: v1.0.3 Downloading: 0.00B [00:00, ?B/s] Traceback (most recent call last): File "/mnt/workspace/facechain/app.py", line 574, in gen_portrait = GenPortrait() File "/mnt/workspace/facechain/facechain/inference_fact.py", line 297, in init self.image_face_fusion = pipeline('face_fusion_torch', File "/usr/local/lib/python3.10/site-packages/modelscope/pipelines/builder.py", line 118, in pipeline model = normalize_model_input( File "/usr/local/lib/python3.10/site-packages/modelscope/pipelines/builder.py", line 36, in normalize_model_input model = snapshot_download( File "/usr/local/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 84, in snapshot_download return _snapshot_download( File "/usr/local/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 241, in _snapshot_download _download_file_lists( File "/usr/local/lib/python3.10/site-packages/modelscope/hub/snapshot_download.py", line 416, in _download_file_lists download_file(url, repo_file, temporary_cache_dir, cache, headers, File "/usr/local/lib/python3.10/site-packages/modelscope/hub/file_download.py", line 606, in download_file file_integrity_validation(temp_file, file_meta[FILE_HASH]) File "/usr/local/lib/python3.10/site-packages/modelscope/hub/utils/utils.py", line 88, in file_integrity_validation file_sha256 = compute_hash(file_path) File "/usr/local/lib/python3.10/site-packages/modelscope/hub/utils/utils.py", line 68, in compute_hash with open(file_path, 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: '/mnt/workspace/.cache/modelscope/hub/._____temp/damo/cv_unet_face_fusion_torch/image_face_fusion/network/init.py'

image
这个可以

@You-Cun
Copy link
Collaborator

You-Cun commented Sep 25, 2024

Modelscope now supports the previous image: ubuntu20.04-cuda11.7.1-py38-torch2.0.1-tf1.15.5-1.8.1. If there still remains problem, please refer to issue #561.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants