ubc-vision / 3dgs-mcmc

Implementation of the paper "3D Gaussian Splatting as Markov Chain Monte Carlo"
https://ubc-vision.github.io/3dgs-mcmc/
Other
254 stars 10 forks source link

math.comb is used in reloc_utils.py but it's not exist in python 3.7.13 #5

Open KotaYonezawa opened 1 week ago

KotaYonezawa commented 1 week ago

Thanks a lot for great code release!

I tried using Windows PC and I faced following error when I ran train.py.

File "C:\Work\3dgs-mcmc\3dgs-mcmc_20240621\utils\reloc_utils.py", line 9, in binoms[n, k] = math.comb(n, k) AttributeError: module 'math' has no attribute 'comb'

According to python document, math.comb was added in python 3.8. But environment.yml specifies that python version is 3.7.13.

I think python version in environment.yml should be modified to newer version, or alternative function same as math.comb should be used in reloc_util.py, like as follows.

def combinations_count(n, k):
    return math.factorial(n) // (math.factorial(n - k) * math.factorial(k))
faster-developer commented 1 week ago

I used conda install python=3.8 to upgrade the Python version.

shakibakh commented 6 days ago

The code is only tested on Ubuntu, the specifics are now updated in README.

NeutrinoLiu commented 6 days ago

specify python=3.8 might lead to some problem when compiling rasterizator, i recommend use scipy.comb as an alternative.