Comments (7)
Thanks for using TrojanZoo.
Haven't used pypi for a long time. Let me check about that. I think it should be okay since the auto CI works fine.
Could you test if you can use python setup.py
to install normally?
from trojanzoo.
Btw, your pytorch version is too low. I've been using quite a lot new features in pytorch 1.8.1.
And Trojanzoo also requires python>=3.9.2
from trojanzoo.
Output from "python setup.py develop"
Traceback (most recent call last):
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 35, in __getattr__
for statement in self.module.body
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 387, in _parse_attr
return getattr(StaticModule(module_name), attr_name)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 43, in __getattr__
) from e
AttributeError: trojanzoo has no attribute __version__
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "setup.py", line 4, in <module>
setuptools.setup()
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/dist.py", line 668, in parse_config_files
ignore_option_errors=ignore_option_errors)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 157, in parse_configuration
meta.parse()
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 463, in parse
section_parser_method(section_options)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 436, in parse_section
self[name] = value
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 220, in __setitem__
value = parser(value)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 552, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/site-packages/setuptools/config.py", line 390, in _parse_attr
module = importlib.import_module(module_name)
File "/home/zjunesa/anaconda2/envs/myh/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/__init__.py", line 5, in <module>
from trojanzoo import environ as environ
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/environ.py", line 3, in <module>
from trojanzoo.utils.environ import *
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/utils/__init__.py", line 5, in <module>
from .tensor import *
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/utils/tensor.py", line 3, in <module>
from .environ import env
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/utils/environ.py", line 4, in <module>
from .param import Param
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/utils/param.py", line 14, in <module>
class Module(MutableMapping[_KT, _VT], Generic[_KT, _VT]):
File "/home/myh/single_ensemble_neuron/trojanzoo-master/trojanzoo/utils/param.py", line 17, in Module
def __init__(self, *args: list[Mapping[_KT, _VT]], **kwargs):
TypeError: 'type' object is not subscriptable
from trojanzoo.
TypeError: 'type' object is not subscriptable
This information shows your python version is lower than 3.9. You shall update it to >=3.9.2
from trojanzoo.
I've tested on python:latest
docker (3.9.4) with running pip install trojanzoo
and it works fine. The basic datasets and models are working well as well, so I think it should be a problem of your local environment.
If you like to use docker, you can just use my trojanzoo docker at https://hub.docker.com/r/local0state/trojanzoo .
Or my environment setting at https://hub.docker.com/r/local0state/base
from trojanzoo.
Thanks! Update to py3.9.0 and pytorch1.8.0 solved my problem.
from trojanzoo.
Thanks! Update to py3.9.0 and pytorch1.8.0 solved my problem.
Great to hear it. But have to tell you python 3.9.2
fixes a type annotation bug of collections.abc.Callable
. You have to make sure your python version >= 3.9.2, otherwise it'll throw exceptions.
It'll be convenient if you are using conda, with command conda install python=3.9.2
from trojanzoo.
Related Issues (20)
- BackdoorAttack class has no argument for source_class HOT 1
- Low effective loading in get_class_subset function HOT 1
- Install newest version fail HOT 1
- Using a custom model HOT 4
- RuntimeError: Dataset not found or corrupted. You can use download=True to download it HOT 10
- Clean label attack accuracy is wrong HOT 5
- In new push model path is not working HOT 1
- badnet folder information HOT 1
- [Error] When I test Neural Cleanse i got a error HOT 2
- Is it possible to apply methods to graph? HOT 6
- Input aware dynamic backdoor error HOT 5
- trojanvision.datasets.ImageFolder HOT 1
- Possible bug: target_class not changed when computing ASR for reversed triggers HOT 2
- problem about saving the intermediate results and config problem HOT 6
- strange mark saved HOT 2
- Hyperparameters for training Resnet18 on CIFAR10? HOT 1
- STRIP implementation doesn't match original codebase HOT 1
- Attack saving and loading is not working HOT 2
- Comp version of networks HOT 2
- Unable to Access Triggered Dataset in BadNet Attack HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trojanzoo.