Coder Social home page Coder Social logo

Comments (7)

ain-soph avatar ain-soph commented on May 24, 2024

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.

ain-soph avatar ain-soph commented on May 24, 2024

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.

AlgebraLoveme avatar AlgebraLoveme commented on May 24, 2024

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.

ain-soph avatar ain-soph commented on May 24, 2024
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.

ain-soph avatar ain-soph commented on May 24, 2024

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.

AlgebraLoveme avatar AlgebraLoveme commented on May 24, 2024

Thanks! Update to py3.9.0 and pytorch1.8.0 solved my problem.

from trojanzoo.

ain-soph avatar ain-soph commented on May 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.