QData / TextAttack

TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/
https://textattack.readthedocs.io/en/master/
MIT License
2.96k stars 396 forks source link

ValueError with attack_dataset. #738

Open weihan1 opened 1 year ago

weihan1 commented 1 year ago

Describe the bug I am playing around with the Attacker API reference and I am running a copy-paste of the first example of textattack.attacker here: https://textattack.readthedocs.io/en/latest/api/attacker.html. The error that I am getting is

ValueError: Trying to load a model of incompatible/unknown type. '/var/folders/6x/gry3zls12tq2cn13snl3qqyc0000gn/T/tfhub_modules/42480c3c7f42bf87d36d4c58fc4374b08dae2909' contains neither 'saved_model.pb' nor 'saved_model.pbtxt'.

To Reproduce Steps to reproduce the behavior:

  1. Copy-paste the example from https://textattack.readthedocs.io/en/latest/api/attacker.html (the one where they start by loading bert-base-uncased).
  2. Run the code and print(attacker.attack_result)

Expected behavior The expected behaviour would be that it would run error-free.

Screenshots or Traceback

Screenshot 2023-05-29 at 5 16 42 PM

System Information (please complete the following information):

Additional context I didn't have this error at all like two weeks ago. I had accidentally deleted my virtual environment, so I lost all the package versions from the time where everything worked. Hope someone can help me out, thanks!

macksjeremy commented 1 year ago

I'm having the same issue, also on MacOS. Are you using an M1 machine?

weihan1 commented 1 year ago

I'm having the same issue, also on MacOS. Are you using an M1 machine?

No, I'm using an M2, but it worked for me recently when I ran it

pipiPdesu commented 3 months ago

This problem may be caused by tensorflow's caching mechanism, I encountered the same problem.