datamllab / tods

TODS: An Automated Time-series Outlier Detection System
http://tods-doc.github.io
Apache License 2.0
1.47k stars 193 forks source link

AttributeError: TODS_PRIMITIVE #72

Open zhiyuanzhang15 opened 2 years ago

zhiyuanzhang15 commented 2 years ago

{ "name": "AttributeError", "message": "TODS_PRIMITIVE", "stack": "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[1;31mAttributeError\u001b[0m Traceback (most recent call last)\n\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mpandas\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 2\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mschemas\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mschemas_utils\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mgenerate_dataset\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mevaluate_pipeline\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\n\u001b[1;32mc:\Users\14496\anaconda3\envs\anomaly\lib\site-packages\tods\init.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mutils\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata_processing\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtimeseries_processing\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfeature_analysis\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdetection_algorithm\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[1;33m*\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\n\u001b[1;32mc:\Users\14496\anaconda3\envs\anomaly\lib\site-packages\tods\data_processing\init.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata_processing\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mCategoricalToBinary\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mCategoricalToBinaryPrimitive\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata_processing\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mColumnFilter\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mColumnFilterPrimitive\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata_processing\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mContinuityValidation\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mContinuityValidationPrimitive\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata_processing\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDatasetToDataframe\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mDatasetToDataFramePrimitive\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtods\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata_processing\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDuplicationValidation\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mDuplicationValidationPrimitive\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\n\u001b[1;32mc:\Users\14496\anaconda3\envs\anomaly\lib\site-packages\tods\data_processing\CategoricalToBinary.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 117\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mprocessed_df\u001b[0m\u001b[1;33m;\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 118\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 119\u001b[1;33m \u001b[1;32mclass\u001b[0m \u001b[0mCategoricalToBinaryPrimitive\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtransformer\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mTransformerPrimitiveBase\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mInputs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mOutputs\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mHyperparams\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 120\u001b[0m \"\"\"\n\u001b[0;32m 121\u001b[0m \u001b[0mA\u001b[0m \u001b[0mprimitive\u001b[0m \u001b[0mwhich\u001b[0m \u001b[0mwill\u001b[0m \u001b[0mconvert\u001b[0m \u001b[0mall\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mdistinct\u001b[0m \u001b[0mvalues\u001b[0m \u001b[0mpresent\u001b[0m \u001b[1;32min\u001b[0m \u001b[0ma\u001b[0m \u001b[0mcolumn\u001b[0m \u001b[0mto\u001b[0m \u001b[0ma\u001b[0m \u001b[0mbinary\u001b[0m \u001b[0mrepresntation\u001b[0m \u001b[1;32mwith\u001b[0m \u001b[0meach\u001b[0m \u001b[0mdistinct\u001b[0m \u001b[0mvalue\u001b[0m \u001b[0mhaving\u001b[0m \u001b[0ma\u001b[0m \u001b[0mdifferent\u001b[0m \u001b[0mcolumn\u001b[0m\u001b[1;33m.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\n\u001b[1;32mc:\Users\14496\anaconda3\envs\anomaly\lib\site-packages\tods\data_processing\CategoricalToBinary.py\u001b[0m in \u001b[0;36mCategoricalToBinaryPrimitive\u001b[1;34m()\u001b[0m\n\u001b[0;32m 157\u001b[0m },\n\u001b[0;32m 158\u001b[0m 'algorithm_types': [\n\u001b[1;32m--> 159\u001b[1;33m \u001b[0mmetadata_base\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPrimitiveAlgorithmType\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mTODS_PRIMITIVE\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 160\u001b[0m ],\n\u001b[0;32m 161\u001b[0m \u001b[1;34m'primitive_family'\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mmetadata_base\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mPrimitiveFamily\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mDATA_PREPROCESSING\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\n\u001b[1;32mc:\Users\14496\anaconda3\envs\anomaly\lib\enum.py\u001b[0m in \u001b[0;36mgetattr\u001b[1;34m(cls, name)\u001b[0m\n\u001b[0;32m 324\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mcls\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_membermap\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 325\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 326\u001b[1;33m \u001b[1;32mraise\u001b[0m \u001b[0mAttributeError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 327\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 328\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mgetitem\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcls\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\n\u001b[1;31mAttributeError\u001b[0m: TODS_PRIMITIVE" }

How to solve this bug?

lhenry15 commented 2 years ago

What is your tamu_d3m version? Would you mind to show us the python packages that you have installed via "pip freeze"?

zhiyuanzhang15 commented 2 years ago

absl-py==0.15.0 aiohttp==3.8.1 aiohttp-cors==0.7.0 aioredis==2.0.1 aiosignal==1.2.0 astunparse==1.6.3 async-timeout==4.0.2 asynctest==0.13.0 attrs==21.4.0 backcall @ file:///home/conda/feedstock_root/build_artifacts/backcall_1592338393461/work backports.functools-lru-cache @ file:///home/conda/feedstock_root/build_artifacts/backports.functools_lru_cache_1618230623929/work backports.zoneinfo==0.2.1 beautifulsoup4==4.11.1 blessings==1.7 cachetools==4.2.4 certifi==2021.5.30 charset-normalizer==2.0.12 click==8.0.4 colorama @ file:///home/conda/feedstock_root/build_artifacts/colorama_1655412516417/work colorful==0.5.4 combo==0.1.3 contextvars==2.4 custom-inherit==2.3.2 cycler==0.11.0 d3m==2022.5.5 dataclasses==0.8 dateparser==1.1.1 decorator @ file:///home/conda/feedstock_root/build_artifacts/decorator_1641555617451/work e==1.4.5 entrypoints @ file:///home/conda/feedstock_root/build_artifacts/entrypoints_1643888246732/work filelock==3.4.1 flatbuffers==1.12 frozendict==1.2 frozenlist==1.2.0 gast==0.3.3 gitdb==4.0.9 GitPython==3.1.20 google==3.0.0 google-api-core==2.8.2 google-auth==2.8.0 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 googleapis-common-protos==1.56.3 gpustat==0.6.0 GPUtil==1.4.0 grpcio==1.32.0 grpcio-testing==1.32.0 grpcio-tools==1.32.0 h5py==2.10.0 idna==3.3 idna-ssl==1.1.0 immutables==0.18 importlib-metadata==4.8.3 importlib-resources==5.4.0 ipykernel @ file:///D:/bld/ipykernel_1620913140366/work/dist/ipykernel-5.5.5-py3-none-any.whl ipython @ file:///D:/bld/ipython_1609697945785/work ipython-genutils==0.2.0 jedi @ file:///D:/bld/jedi_1605054785407/work joblib==1.1.0 jsonpath-ng==1.5.3 jsonschema==4.0.0 jupyter-client @ file:///home/conda/feedstock_root/build_artifacts/jupyter_client_1642858610849/work jupyter-core @ file:///D:/bld/jupyter_core_1631852848502/work Keras==2.4.0 Keras-Preprocessing==1.1.2 kiwisolver==1.3.1 liac-arff==2.5.0 llvmlite==0.36.0 Markdown==3.3.7 matplotlib==3.3.4 more-itertools==8.5.0 msgpack==1.0.4 multidict==5.2.0 mypy-extensions==0.4.3 nest-asyncio @ file:///home/conda/feedstock_root/build_artifacts/nest-asyncio_1648959695634/work networkx==2.4 nimfa==1.4.0 numba==0.53.1 numpy==1.19.5 nvidia-ml-py3==7.352.0 oauthlib==3.2.0 opencensus==0.9.0 opencensus-context==0.1.2 openml==0.11.0 opt-einsum==3.3.0 pandas==1.1.5 parso @ file:///home/conda/feedstock_root/build_artifacts/parso_1595548966091/work patsy==0.5.2 pickleshare @ file:///home/conda/feedstock_root/build_artifacts/pickleshare_1602536217715/work Pillow==7.1.2 ply==3.11 prometheus-client==0.14.1 prompt-toolkit @ file:///home/conda/feedstock_root/build_artifacts/prompt-toolkit_1656332401605/work protobuf==3.19.4 psutil==5.9.1 py-spy==0.3.12 pyasn1==0.4.8 pyasn1-modules==0.2.8 Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1650904496387/work pyod==1.0.2 pyparsing==3.0.9 pyrsistent==0.18.0 python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1626286286081/work pytypes==1.0b10 pytz==2022.1 pytz-deprecation-shim==0.1.0.post0 PyWavelets==1.1.1 pywin32==301 PyYAML==5.4.1 pyzmq @ file:///D:/bld/pyzmq_1631793604214/work ray==1.0.1.post1 redis==3.4.1 regex==2022.3.2 requests==2.26.0 requests-oauthlib==1.3.1 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rsa==4.8 scikit-learn==0.24.2 scipy==1.5.4 simplejson==3.12.0 six==1.15.0 smmap==5.0.0 soupsieve==2.3.2.post1 statsmodels==0.11.1 stumpy==1.4.0 tamu-axolotl==2021.4.8 tamu-d3m==2022.5.23 tensorboard==2.9.1 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorflow==2.4.0 tensorflow-estimator==2.4.0 termcolor==1.1.0 threadpoolctl==3.1.0 tods @ file:///C:/Users/14496/tods tornado @ file:///D:/bld/tornado_1610094881553/work traitlets @ file:///home/conda/feedstock_root/build_artifacts/traitlets_1631041982274/work typing-extensions==3.7.4.3 typing-inspect==0.7.1 tzdata==2022.1 tzlocal==4.2 urllib3==1.26.9 wcwidth @ file:///home/conda/feedstock_root/build_artifacts/wcwidth_1600965781394/work webcolors==1.11.1 Werkzeug==2.0.3 wincertstore==0.2 wrapt==1.12.1 xmltodict==0.13.0 yarl==1.7.2 zipp==3.6.0

hello, i run it on windows system. i think maybe because of this system?

lhenry15 commented 2 years ago

I see. Currently, we only support linux system and we are working on supporting Windows system. You may want to use Linux system for now. But the error message you got is not because of the system. Instead, it's because you have both "tamu_d3m" and "d3m" at the same time. This issue may due to the reason that tods to use vanilla "d3m" as the backbone instead of "tamu_d3m" and therefore not able to recognize TODS_PRIMITIVE attributes. Anyway, thanks for the information we will keep an eye on this issue to see if there are some bug during the installation process.

soso-maitha commented 2 years ago

is the package still not supported for Windows?

AhmadUsc commented 1 year ago

this problem appeared, even though I installed TODS on Ubuntu. what is the problem?