Deep-Taylor-Decomposition
Deep-Taylor-Decomposition copied to clipboard
How to run this project on my personal inputa image datasets
I have prepared the pytorch packages and everything, but when I run the main.py, the wrong infos come out like:
test setup failed file C:\Users\lin\Desktop\gradduate_design\Deep Taylor for interpretation\Deep-Taylor-Decomposition-master\main.py, line 41 def test(args): E fixture 'args' not found
available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, record_xml_property, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory use 'pytest --fixtures [testpath]' for help on them.
and then I look for the solutions on this and try to change the test function name from 'test' to 'tes' so as not to get confusion, and add '@pytest.fixture' before the 'def tes(args)', and run, but then I get the error like:
2020-09-15 09:13:16,838 [INFO] data loading (main.py:51)
2020-09-15 09:13:16,838 [ERROR] Testing is falied (main.py:176)
Traceback (most recent call last):
File "C:/Users/lin/Desktop/gradduate_design/Deep Taylor for interpretation/Deep-Taylor-Decomposition-master/main.py", line 174, in
Anyway, I don't know how to right run your code, and I wanna use DTD to interpret my datasets! Expected to hear from the solutions as soon as possible!
Note: I´m running windows 10, I used python 3.9.6 and used a virtual environment ( https://pypi.org/project/virtualenv/ ), which I don´t think is needed to run the repository but just in case I share that info. In my case: I downloaded the repository as a .zip, extracted it, created a folder in the main folder (in my case with the name "imgs") where I put a second folder containing the image to be analyzed. So, the location of the image was "imgs\images\myimage.png" within the main folder. Then, open a cmd window, located it in the main folder, and enter the command: python main.py --test_dir .\imgs
After a few seconds, that created as output the folder "saliency_map_sample" within which you could find the original image and the generated explanation.
Hope that could help. 👋
Note: I´m running windows 10, I used python 3.9.6 and used a virtual environment ( https://pypi.org/project/virtualenv/ ), which I don´t think is needed to run the repository but just in case I share that info. In my case: I downloaded the repository as a .zip, extracted it, created a folder in the main folder (in my case with the name "imgs") where I put a second folder containing the image to be analyzed. So, the location of the image was "imgs\images\myimage.png" within the main folder. Then, open a cmd window, located it in the main folder, and enter the command: python main.py --test_dir .\imgs
After a few seconds, that created as output the folder "saliency_map_sample" within which you could find the original image and the generated explanation.
Hope that could help. 👋
There are many pictures in my folder, but I can only get one result at a time. How can I get the result of all pictures at once?