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

FileNotFoundError: [Errno 2] No such file or directory: 'tmp/vqaxxxxxx.jpg #39

Open
LZY-233 opened this issue Nov 20, 2024 · 1 comment

Comments

@LZY-233
Copy link

LZY-233 commented Nov 20, 2024

When I run the vqa_lxmert_unimodallime.py, I get an error of FileNotFoundError just likeFileNotFoundError: [Errno 2] No such file or directory: 'tmp/vqa87721637.jpg' and I have downloaded the dataset as you asked and and unzip all in a folder named structured-framework/data. I don't know how to fix this error, can you help me fix it? thank you.
my environment is

  • ubuntu20.04
  • python3.8
  • torch2.0.0
  • cuda11.8
    The following is the complete error message
    Traceback (most recent call last):
    File "examples/vqa_lxmert_unimodallime.py", line 22, in
    explanation1 = rununimodallime(
    File "/root/autodl-tmp/MultiViz/structured-framework/analysis/unimodallime.py", line 65, in rununimodallime
    return lime_explainer.explain_instance(
    File "/root/miniconda3/lib/python3.8/site-packages/lime/lime_image.py", line 198, in explain_instance
    data, labels = self.data_labels(image, fudged_image, segments,
    File "/root/miniconda3/lib/python3.8/site-packages/lime/lime_image.py", line 261, in data_labels
    preds = classifier_fn(np.array(imgs))
    File "/root/autodl-tmp/MultiViz/structured-framework/analysis/unimodallime.py", line 27, in classify
    modifiedinputs = [
    File "/root/autodl-tmp/MultiViz/structured-framework/analysis/unimodallime.py", line 28, in
    analysismodel.replaceunimodaldata(datainstance, modalityname, i)
    File "/root/autodl-tmp/MultiViz/structured-framework/models/vqa_lxmert.py", line 119, in replaceunimodaldata
    plt.imsave(randname, newinput)
    File "/root/miniconda3/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2200, in imsave
    return matplotlib.image.imsave(fname, arr, **kwargs)
    File "/root/miniconda3/lib/python3.8/site-packages/matplotlib/image.py", line 1689, in imsave
    image.save(fname, **pil_kwargs)
    File "/root/miniconda3/lib/python3.8/site-packages/PIL/Image.py", line 2428, in save
    fp = builtins.open(filename, "w+b")
    FileNotFoundError: [Errno 2] No such file or directory: 'tmp/vqa87721637.jpg'
@LZY-233
Copy link
Author

LZY-233 commented Nov 20, 2024

Just to add, I didn't change the code

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

No branches or pull requests

1 participant