Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues getting it to work on CPU only mac (Catalina 10.15.4) #32

Closed
tmbouman opened this issue Apr 20, 2020 · 7 comments
Closed

Issues getting it to work on CPU only mac (Catalina 10.15.4) #32

tmbouman opened this issue Apr 20, 2020 · 7 comments

Comments

@tmbouman
Copy link

tmbouman commented Apr 20, 2020

I don't think it is possible, but can this run on a CPU only macbook pro? Below is the error output on my last 2013 MBP with retina integrated graphics

Also, if you are running a NVIDIA GPU mac book pro you'll need to change this line
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit==10.1.243 -c pytorch
To this:
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit==9.0 -c pytorch

Output I get on my machine:
initialize
device: cpu
start processing
processing image/4O5A8714.jpg (1/1)
torch.Size([1, 3, 256, 384])
finished
Start Running 3D_Photo ...
Traceback (most recent call last):
File "main.py", line 95, in
depth_feat_model)
File "/Users/tmbouman/Documents/GitHub/3d-photo-inpainting/mesh.py", line 1877, in write_ply
depth_edge_model, depth_feat_model, rgb_model, config, direc="up")
File "/Users/tmbouman/Documents/GitHub/3d-photo-inpainting/mesh_tools.py", line 193, in extrapolate
t_edge = torch.FloatTensor(edge).to(device)[None, None, ...]
File "/Users/tmbouman/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/cuda/init.py", line 196, in _lazy_init
_check_driver()
File "/Users/tmbouman/anaconda3/envs/3DP/lib/python3.7/site-packages/torch/cuda/init.py", line 94, in _check_driver
raise AssertionError("Torch not compiled with CUDA enabled")

@LemonATsu
Copy link
Collaborator

To run with CPU, set gpu_ids to -1 in argument.yml. I think 2013 MBP is probably too old for this thing, but you can play it with our colab notebook if you don't have other GPU-equipped machines.

@tmbouman
Copy link
Author

Hi LemonATsu,
Thanks for the reply. COLAB!!! I had never heard of this before. Awesome! and even better it worked haha. Thanks for your quick reply.

I will try the gpu_id = -1 and report back if it works for others.

@mbrav
Copy link

mbrav commented Apr 20, 2020

To run with CPU, set gpu_ids to -1 in argument.yml. I think 2013 MBP is probably too old for this thing, but you can play it with our colab notebook if you don't have other GPU-equipped machines.

Not directly related to the issue, but on the other hand, how do I specify the ID of my GPU (Nvidia GTX1660Ti) and where can I get this ID? Running on Linux. Thanks!

@LemonATsu
Copy link
Collaborator

LemonATsu commented Apr 20, 2020

Not directly related to the issue, but on the other hand, how do I specify the ID of my GPU (Nvidia GTX1660Ti) and where can I get this ID? Running on Linux. Thanks!

Try using the command nvidia-smi to see the available GPUs (and their IDs).

@tmbouman
Copy link
Author

Hi LemonATsu,
Thanks for the reply. COLAB!!! I had never heard of this before. Awesome! and even better it worked haha. Thanks for your quick reply.

I will try the gpu_id = -1 and report back if it works for others.

For those looking to do this with their mac with CPU only. You'll need more than 16GB of ram (like my machine has). After setting gpu_id = -1, the code would run, but used 8GB according to activity monitor then finally crashed while writing out the first movie file. The error was an explained here:
Zulko/moviepy#752

which basically says you need more ram. This was using a picture of dimension 4794 × 3196. I tried with a 300x450, same result.

@victusfate
Copy link

tried on mac as well hit a render issue

  File "main.py", line 117, in <module>
    videos_poses, video_basename, config.get('original_h'), config.get('original_w'), border=border, depth=depth, normal_canvas=normal_canvas, all_canvas=all_canvas)
  File "/Users/messel/Desktop/Dropbox/code/welcome/3d-photos/mesh.py", line 2203, in output_3d_photo
    proj='perspective')
  File "/Users/messel/Desktop/Dropbox/code/welcome/3d-photos/mesh.py", line 2132, in __init__
    self.canvas = scene.SceneCanvas(bgcolor=bgcolor, size=(canvas_size*factor, canvas_size*factor))
  File "/Users/messel/.pyenv/versions/3.7.2/lib/python3.7/site-packages/vispy/scene/canvas.py", line 137, in __init__
    always_on_top, px_scale)
  File "/Users/messel/.pyenv/versions/3.7.2/lib/python3.7/site-packages/vispy/app/canvas.py", line 169, in __init__
    self._app = use_app(call_reuse=False)
  File "/Users/messel/.pyenv/versions/3.7.2/lib/python3.7/site-packages/vispy/app/_default_app.py", line 47, in use_app
    default_app = Application(backend_name)
  File "/Users/messel/.pyenv/versions/3.7.2/lib/python3.7/site-packages/vispy/app/application.py", line 49, in __init__
    self._use(backend_name)
  File "/Users/messel/.pyenv/versions/3.7.2/lib/python3.7/site-packages/vispy/app/application.py", line 256, in _use
    'PyQt' % [b[0] for b in CORE_BACKENDS])
RuntimeError: Could not import any of the backends. You need to install any of ['PyQt4', 'PyQt5', 'PySide', 'PySide2', 'Pyglet', 'Glfw', 'SDL2', 'wx', 'EGL', 'osmesa']. We recommend PyQt
  0%|                                                                                           | 0/1 [05:46<?, ?it/s]
python main.py --config argument.yml  618.59s user 17.27s system 178% cpu 5:55.50 total

Will try PyQt5 and share my findings. Planning on running it on ec2, but it's handy to be able debug servers locally.

Update took 6:37.36 minutes total, Macbook Pro 2.9Ghz 6-Core Intel i9, peak memory 10.8GB
image resolution 640x480

@sdan
Copy link

sdan commented Apr 28, 2020

I utilize the regular EGL because nvidia-docker supports offscreen rendering (but it took a lot of time to figure this out). I'm hosting it on https://sdan.io/3d for everyone to use!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants