taichi-dev / taichi_three

A soft renderer based on Taichi (work in progress)
https://t3.142857.red/
MIT License
223 stars 24 forks source link

A fresh installation fails verify installation test (type object 'Matrix' has no attribute 'is_global') #50

Closed ghost closed 3 years ago

ghost commented 3 years ago

Taichi install looks good:

$ python3 -m pip install taichi
Collecting taichi
  Downloading taichi-0.7.31-cp38-cp38-manylinux1_x86_64.whl (24.4 MB)
     |████████████████████████████████| 24.4 MB 9.8 MB/s 
Collecting astor
  Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting numpy
  Downloading numpy-1.21.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.8 MB)
     |████████████████████████████████| 15.8 MB 10.3 MB/s 
Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (from taichi) (0.4.3)
Collecting sourceinspect>=0.0.4
  Downloading sourceinspect-0.0.4-py3-none-any.whl (3.5 kB)
Collecting pybind11>=2.5.0
  Downloading pybind11-2.7.1-py2.py3-none-any.whl (200 kB)
     |████████████████████████████████| 200 kB 11.9 MB/s 
Collecting dill
  Downloading dill-0.3.4-py2.py3-none-any.whl (86 kB)
     |████████████████████████████████| 86 kB 1.3 MB/s 
Installing collected packages: astor, numpy, dill, sourceinspect, pybind11, taichi
Successfully installed astor-0.8.1 dill-0.3.4 numpy-1.21.2 pybind11-2.7.1 sourceinspect-0.0.4 taichi-0.7.31

Tina install looks good:

$ python3 -m pip install taichi-tina
Collecting taichi-tina
  Downloading taichi_tina-0.1.1-py3-none-any.whl (93 kB)
     |████████████████████████████████| 93 kB 304 kB/s 
Requirement already satisfied: taichi in ./.local/lib/python3.8/site-packages (from taichi-tina) (0.7.31)
Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (from taichi->taichi-tina) (0.4.3)
Requirement already satisfied: numpy in ./.local/lib/python3.8/site-packages (from taichi->taichi-tina) (1.21.2)
Requirement already satisfied: pybind11>=2.5.0 in ./.local/lib/python3.8/site-packages (from taichi->taichi-tina) (2.7.1)
Requirement already satisfied: astor in ./.local/lib/python3.8/site-packages (from taichi->taichi-tina) (0.8.1)
Requirement already satisfied: sourceinspect>=0.0.4 in ./.local/lib/python3.8/site-packages (from taichi->taichi-tina) (0.0.4)
Requirement already satisfied: dill in ./.local/lib/python3.8/site-packages (from sourceinspect>=0.0.4->taichi->taichi-tina) (0.3.4)
Installing collected packages: taichi-tina
Successfully installed taichi-tina-0.1.1

Running the python -c "import tina; print(tina)" test from the README throws this error:

$ python3 -c "import tina; print(tina)"
[Tina] version 0.1.1
[Taichi] version 0.7.31, llvm 10.0.0, commit fa68168a, linux, python 3.8.10
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/__init__.py", line 22, in <module>
    from .hacker import *
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/hacker.py", line 10, in <module>
    ti.Matrix.is_global)) or setattr(ti.TaichiOperations, '__pos__',
AttributeError: type object 'Matrix' has no attribute 'is_global'

Thanks in advance! :)

ghost commented 3 years ago

Matrix had is_global a year ago: https://github.com/taichi-dev/taichi/blob/89157b2/python/taichi/lang/matrix.py#L93-L101 But not anymore, it seems: https://github.com/taichi-dev/taichi/blob/master/python/taichi/lang/matrix.py

ghost commented 3 years ago

https://github.com/taichi-dev/taichi/pull/2050#issuecomment-760775596 :slightly_smiling_face:

ghost commented 3 years ago

If I temporarily delete is_global part, then I get this error:

$ python3 -c "import tina; print(tina)"
[Tina] version 0.1.1
[Taichi] version 0.7.31, llvm 10.0.0, commit fa68168a, linux, python 3.8.10
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/__init__.py", line 22, in <module>
    from .hacker import *
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/hacker.py", line 8, in <module>
    and f(x, y, z))(ti.Matrix.element_wise_writeback_binary)) or setattr(ti.TaichiOperations, '__pos__',
  File "/home/constantine/.local/lib/python3.8/site-packages/taichi/__init__.py", line 30, in __getattr__
    raise AttributeError(f"module '{__name__}' has no attribute '{attr}'")
AttributeError: module 'taichi' has no attribute 'TaichiOperations'

I guess Tina is not up to date with the latest Taichi yet :slightly_smiling_face:

ghost commented 3 years ago

Removing TaichiOperations part yields:

$ python3 -c "import tina; print(tina)"
[Tina] version 0.1.1
[Taichi] version 0.7.31, llvm 10.0.0, commit fa68168a, linux, python 3.8.10
[Tina] Taichi properties hacked
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/__init__.py", line 22, in <module>
    from .hacker import *
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/hacker.py", line 50, in <module>
    def _():
  File "<string>", line 1, in <lambda>
  File "/home/constantine/.local/lib/python3.8/site-packages/tina/hacker.py", line 57, in _
    from taichi.lang.transformer import ASTTransformerBase, ASTTransformerPreprocess
ImportError: cannot import name 'ASTTransformerPreprocess' from 'taichi.lang.transformer' (/home/constantine/.local/lib/python3.8/site-packages/taichi/lang/transformer.py)
archibate commented 3 years ago

Sorry for assuming too much in Taichi internal design :) Using pip install taichi==0.6.8 may fix the issue for now.

无法顺畅的大口呼吸,是活着的最好证明

---Original--- From: @.> Date: Mon, Sep 6, 2021 12:54 PM To: @.>; Cc: @.***>; Subject: Re: [taichi-dev/taichi_three] A fresh installation fails verify installation test (type object 'Matrix' has no attribute 'is_global') (#50)

Removing TaichiOperations part yields: $ python3 -c "import tina; print(tina)" [Tina] version 0.1.1 [Taichi] version 0.7.31, llvm 10.0.0, commit fa68168a, linux, python 3.8.10 [Tina] Taichi properties hacked Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/constantine/.local/lib/python3.8/site-packages/tina/init.py", line 22, in <module> from .hacker import * File "/home/constantine/.local/lib/python3.8/site-packages/tina/hacker.py", line 50, in <module> def (): File "<string>", line 1, in <lambda> File "/home/constantine/.local/lib/python3.8/site-packages/tina/hacker.py", line 57, in from taichi.lang.transformer import ASTTransformerBase, ASTTransformerPreprocess ImportError: cannot import name 'ASTTransformerPreprocess' from 'taichi.lang.transformer' (/home/constantine/.local/lib/python3.8/site-packages/taichi/lang/transformer.py)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ghost commented 3 years ago

@archibate cool, thanks!