OFA-Sys / ONE-PEACE

A general representation model across vision, audio, language modalities. Paper: ONE-PEACE: Exploring One General Representation Model Toward Unlimited Modalities
Apache License 2.0
935 stars 57 forks source link

I have some problems trying the examples on ModelScope on my local environment #18

Closed 475517631 closed 1 year ago

475517631 commented 1 year ago

Hello author, I try to run the demo of one_peace on the linux environment, and it shows ModuleNotFoundError: No module name 'modelscope' when I run it. But I have already installed the package on the local environment, but it still shows this problem. How can I solve this problem?

simonJJJ commented 1 year ago

Can you show the full error info?

475517631 commented 1 year ago

Traceback (most recent call last): File "/home/mrcoco/PycharmProjects/onepeace/main.py", line 1, in from modelscope.models import Model ModuleNotFoundError: No module named 'modelscope' But I have already installed 'modelscope'

simonJJJ commented 1 year ago

run

python -c "import modelscope; print(modelscope.__version__)"

See the print info.

475517631 commented 1 year ago

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module namedmodelscope

475517631 commented 1 year ago

But when I used the 'pip list' command to view, the project already had modelscope 1.6.1 installed

simonJJJ commented 1 year ago

Make sure you are using the same environment when running your code and pip list.

475517631 commented 1 year ago

I am sure that all the environments and instructions for my terminal installation on Pycharm

simonJJJ commented 1 year ago

I guess the environment of the terminal is different from the project in Pycharm.

logicwong commented 1 year ago

@475517631 You can also try running this API as it does not rely on modelscope.

475517631 commented 1 year ago

Traceback (most recent call last): File "/home/mrcoco/PycharmProjects/onepeace/main.py", line 2, in from one_peace.models import from_pretrained ModuleNotFoundError: No module named 'one_peace'
I have encountered a new problem. how can I solve this problem

logicwong commented 1 year ago

@475517631 Please make sure you have installed the dependencies and ensure that the current path is under the ONE-PEACE directory.

git clone https://github.com/OFA-Sys/ONE-PEACE
cd ONE-PEACE
pip install -r requirements.txt
475517631 commented 1 year ago

Hello, I encountered the following error while trying to use the API. Can I just add the corresponding image to the project

/home/mrcoco/anaconda3/envs/modelscope/lib/python3.7/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  ../aten/src/ATen/native/TensorShape.cpp:2228.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
Traceback (most recent call last):
  File "/home/mrcoco/PycharmProjects/onepeace/ONE-PEACE/test.py", line 10, in <module>
    src_images = model.process_image(["dog.JPEG", "elephant.JPEG"])
  File "/home/mrcoco/PycharmProjects/onepeace/ONE-PEACE/one_peace/models/one_peace/hub_interface.py", line 145, in process_image
    image = [Image.open](http://image.open/)(image_path).convert("RGB")
  File "/home/mrcoco/anaconda3/envs/modelscope/lib/python3.7/site-packages/PIL/Image.py", line 2975, in open
    fp = [builtins.open](http://builtins.open/)(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'dog.JPEG'
logicwong commented 1 year ago

@475517631 We have uploaded the missing files in ONE-PEACE/assets, please check out our latest commit and have a try.

475517631 commented 1 year ago

Hello, may I ask how similar is the API provided when running? I feel that the accuracy of the API I ran in the local environment is a bit low.

logicwong commented 1 year ago

There is no difference between them, they all use the same reasoning logic. Currently, ONE-PEACE is trained on English image-text pairs and audio-text pairs, and only environmental sound data is used for audio. Please make sure you are using the API correctly.

475517631 commented 1 year ago

Image-to-text similarities: tensor([[0.1840, 0.3433, 0.1412], [0.0658, 0.0098, 0.2945]], device='cuda:0') Audio-to-text similarities: tensor([[0.3892, 0.0900, 0.2268], [0.0334, 0.2066, 0.0468]], device='cuda:0')

475517631 commented 1 year ago

Hello, I ran the demo you provided and the results are shown above. May I ask if this result is correct

logicwong commented 1 year ago

Yes, it's correct.

apking2000 commented 8 months ago

Hi can you guys tell me the configuration of gpu device to run this model i am trying to run this model but my kernel died, thanks