Bug when running the space locally

#7
by elioonpc - opened

when i run the app.py i get this error message what could be the reason for it
Traceback (most recent call last):
File "C:\Users\user\Shap-E\app.py", line 8, in
from app_image_to_3d import create_demo as create_demo_image_to_3d
File "C:\Users\user\Shap-E\app_image_to_3d.py", line 9, in
from model import Model
File "C:\Users\user\Shap-E\model.py", line 53, in
xm: Transmitter | VectorDecoder,
TypeError: unsupported operand type(s) for |: 'type' and 'type'

Hi @elioonpc I think the error occurs when you use old Python. This Space is using Python 3.10.11, so you might want to try that. Or, you can try removing type annotations as well.

@elioonpc

Change the function with this:

def decode_latent_mesh(xm, latent):
decoded = xm.renderer.render_views(
AttrDict(cameras=create_pan_cameras(
2, latent.device)), # lowest resolution possible
params=(xm.encoder if isinstance(xm, Transmitter) else
xm).bottleneck_to_params(latent[None]),
options=AttrDict(rendering_mode='stf', render_with_direction=False),
)
return decoded.raw_meshes[0]

@hysts this space doesn't run on MacOS. Anyway, you can modify it to enable it to run on mps as well?

Hi @ghpkishore
I'm not sure if we can make this Space work on MPS as I'm not familiar with the Mac environment. I usually test my Spaces only on Ubuntu.
There seems to be multiple issues in the original repo about Mac, so maybe it's not easy. This Space is basically a GUI wrapper of the original code, so we can update the Space once they update their code to make it work on MPS, though.

hysts changed discussion status to closed

Sign up or log in to comment