zxix / stable-diffusion-pickle-scanner

187 stars 20 forks source link

AttributeError: 'dict' object has no attribute 'calls' #3

Open derekleighstark opened 1 year ago

derekleighstark commented 1 year ago

(base) PS G:\stable-diffusion-webui> python pickle_scan.py models > scan_output.txt Traceback (most recent call last): File "G:\stable-diffusion-webui\pickle_scan.py", line 35, in for c in result.calls: AttributeError: 'dict' object has no attribute 'calls'

Getting this error when I run things.

champred commented 1 year ago

Getting the same error with Pytorch 1.13.0 and Python 3.10.8 on Windows 10.

wongfei2009 commented 1 year ago

I got the same error. But following the instruction like this ""F:\Projects\stable-diffusion-webui\venv\Scripts\Python.exe" pickle_scan.py models > scan_output.txt" fixes my problem.

Marcus-Arcadius commented 1 year ago

@wongfei2009 I tried this doing this but got the same error still....

lopho commented 1 year ago

pytorch 1.13.0 breaks custom unpickle modules.

BaronBrabant commented 1 year ago

I got the same error. But following the instruction like this ""F:\Projects\stable-diffusion-webui\venv\Scripts\Python.exe" pickle_scan.py models > scan_output.txt" fixes my problem.

This fixed it for me too! thank you kind sir for helping me not get pickled

aacuevas commented 1 year ago

Same happens to me after following these instructions to improve performance on my 4090 which, indeed, replaced pytorch with 1.13.1

raven38 commented 1 year ago

https://github.com/pytorch/pytorch/commit/9f11ce7f67612d1c11f1a6a9b264779b27062e82 The commit in pytorch may solve the issue. We can use the master branch of pytorch or wait for the future release.

NaveenUpadhyaya commented 1 year ago

Changing result.calls to result_calls fixed the issue for me.

zxix commented 1 year ago

Seeing a lot of conflicting issues and solutions here, will have to test.

hal0thane commented 1 year ago

For those running on macOS or Linux, you should use this version of the command that @wongfei2009 offered, assuming that you are in the AUTOMATIC1111 (aka stable-diffusion-webui) base directory:

$ ./venv/bin/python3 pickle_scan.py models >scan_output.txt

and for everyone, don't forget to scan your embeddings folder as well, since it does not live under models:

$ ./venv/bin/python3 pickle_scan.py embeddings >embeddings_scan.txt

nitingrg commented 1 year ago

getting this error --

H:\stabledif\stable-diffusion-webui>cmd /C "H:\stabledif\stable-diffusion-webui\venv\Scripts\Python.exe" pickle_scan.py models  1>scan_output.txt
Traceback (most recent call last):
  File "H:\stabledif\stable-diffusion-webui\pickle_scan.py", line 37, in <module>
    for c in result.calls:
AttributeError: 'dict' object has no attribute 'calls'

if I change results.call to results_call the scan fails

ethicallyrooted commented 1 year ago

Changing result.calls to result_calls fixed the issue for me.

Making this change fixed it for me also

huyzer commented 1 year ago

Changing result.calls to result_calls fixed the issue for me.

Making this change fixed it for me also

That worked for me, too. But now my results say for all my models:

library call (net.): 0 library call (shutil.): 0 library call (sys.): 0 library call (requests.): 0 library call (os.): 0 malicious signal (cat ): 0 malicious signal (rm ): 0 malicious signal (/bin/sh ): 0 malicious signal (nc ): 0 non-standard calls: 5 total: 5

SCAN FAILED

I'm worried. Should I be?

PortalArm commented 1 year ago

pytorch/pytorch@9f11ce7 The commit in pytorch may solve the issue. We can use the master branch of pytorch or wait for the future release.

This resolved the issue for me. Just manually edited torch/serialization.py

Furluge commented 1 year ago

pytorch/pytorch@9f11ce7 The commit in pytorch may solve the issue. We can use the master branch of pytorch or wait for the future release.

This resolved the issue for me. Just manually edited torch/serialization.py

I this also fixed the issue for me.

jonk999 commented 1 year ago

pytorch/pytorch@9f11ce7 The commit in pytorch may solve the issue. We can use the master branch of pytorch or wait for the future release.

This resolved the issue for me. Just manually edited torch/serialization.py

Are you able to explain more on what to do. I am getting the error, but don't fully understand what to do to correct it.

Error: "Scanning...Please wait a moment..." "step 1: SD models folder" Traceback (most recent call last): File "H:\stabledif\stable-diffusion-webui\pickle_scan.py", line 37, in for c in result.calls: AttributeError: 'dict' object has no attribute 'calls'

Aryetis commented 1 year ago

Changing result.calls to result_calls fixed the issue for me.

By doing so l.37 of pickle_scan.py is gonna loop around the empty result_calls instead of looping on the result given by the pickle_inspector. (At least that's what my old rusty python skills are telling me, correct me if I'm wrong). So yeah it's gonna silence the error.... But it won't fix anything. I'm still looking for a fix myself, just letting others know that this is probably not a correct one.

EDIT : Editing torch's serialization.py file like mentioned above does fix the issue however.