Comments (5)
@michele-arrival this is not because of the blend params but the rasterization settings. Currently your values are:
raster_settings = RasterizationSettings(
image_size=frame_size,
blur_radius=np.log(1.0 / 1e-4 - 1.0) * blend_params.sigma,
faces_per_pixel=2,
bin_size=1
)
There are two implementations of rasterization in pytorch3d and the approach that is used is determined by the value of the bin_size
setting.
The first naive approach (when bin_size = 0
) loops through all the faces in the mesh for each pixel. The second approach (when bin_size > 0) involves two steps the first of which is a coarse step where the image is split into a rough grid (or bins) and each face in the mesh is assigned to a grid cell (or bin). The second step loops through each pixel and only looks at the faces in the bin in which the pixel lies. Refer to the docs on the renderer for more details on this 'coarse-to-fine' approach: https://pytorch3d.org/docs/renderer. Also refer to the PyTorch3D API docs for the rasterizer here
For coarse-to-fine rasterization the bin_size
setting determines the number of bins and in this case you have set it to 1. There is an upper bound on the number of faces which can be allocated to each bin and as the error mentions Got 256; that's too many!
(for reference with, the error is from RasterizeMeshesCoarseCuda
to help you debug such issues in future).
If you want to enable the coarse-to-fine rasterization you can just leave the bin_size
empty and it will be set based on heuristics. If you want to use the naive rasterization approach you can set bin_size = 0
.
from pytorch3d.
Yes sorry of course I meant RasterizationSettings
.
Thanks for the explanation, I understand now.
I guess a clearer error message wouldn't be too bad though. For one thing it looks like a low level exception, not a user error, even thought it is. Also It's not immediately clear what *that*
in that's too many
is.
As a side note, when the image is big (> 1024) leaving bin_size
out of the settings means another kind of exception incompatible function arguments
later on.
see here where bin_size remains None
:
pytorch3d/pytorch3d/renderer/mesh/rasterize_meshes.py
Lines 93 to 121 in dbf06b5
Cheers!
from pytorch3d.
@michele-arrival, yes we could definitely make the error message clearer. Thanks for pointing out the error for when image size is > 1024. We assumed that most use cases involving batched rendering of meshes would require image sizes < 1024, but we can fix this so that rendering is enabled with any image size. Feel free to submit a PR if you would like to try and fix this yourself!
from pytorch3d.
from pytorch3d.
@michele-arrival your PR has been merged so I am closing this issue.
from pytorch3d.
Related Issues (20)
- explain this erroer message on my miniconda and the best possible code to resolve it ...traceback (most recent call last): File "afy/cam_fomm.py", line 316, in <module> out = predictor.predict(frame) File "C:\Users\mikey\avatarify-python\afy\predictor_local.py", line 102, in predict kp_norm = normalize_kp(kp_source=self.kp_source, kp_driving=kp_driving, File "C:\Users\mikey\avatarify-python\afy\predictor_local.py", line 28, in normalize_kp jacobian_diff = torch.matmul(kp_driving['jacobian'], torch.inverse(kp_driving_initial['jacobian'])) RuntimeError: CUDA error: operation not supported when calling `cusparseCreate(handle)`
- dl.fbaipublicfiles.com dead HOT 1
- Proper MeshRasterizerOpenGL usage HOT 3
- How to add a spot light (cone light) in PyTorch3D for projecting a 2D pattern onto 3D surfaces?
- MeshRenderer gives unexpected result for non-square image_size HOT 1
- Install pytorch3d in aarch64/arm Linux architecture HOT 4
- Add EnvMapLights Class for Environment Map Lighting
- install pytorch3d
- Can't find pytorch3d version 0.7.6 in pytorch3d channel (conda) HOT 1
- RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 4 HOT 1
- Texture disorder HOT 14
- cannot import name 'MeshesXD' from 'pytorch3d.structures HOT 1
- Get error from ninja. HOT 5
- how to apply pytorch3d to reconstruct 3d face pointclouds using the rgb and deepmap of one face (both got from pytorch3d) HOT 1
- Got ERROR: Failed building wheel for pytorch3d HOT 2
- Installation error under LINUX HOT 7
- Encountered a compilation error: the required .o files were not generated. HOT 4
- unable to build from source - `cannot import name 'packaging' from 'pkg_resources'` HOT 6
- latest version of pytorch3d does not support crop_bbox_xywh from CO3Dv2 HOT 3
- ModuleNotFoundError: No module named 'pytorch3d.structures' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch3d.