Skip to content

Conversation

Tail-19
Copy link

@Tail-19 Tail-19 commented Jan 13, 2025

PyTorch added support for M1 GPU as of 2022-05-18 in the Nightly version, this version made some small modifications to make it also work on Mac without any changes to the original workflow. The code is tested on the Apple M1 Max chip with torch 2.4.1
torchvision 0.19.1

@NerdToMars
Copy link

thx for the PR, it's quite useful, so I created a uv with help of AI

[project]
name = "nerf-pytorch"
version = "0.1.0"
description = "PyTorch implementation of NeRF (Neural Radiance Fields) for view synthesis"
authors = [
    {name = "Yen-Chen Lin", email = "[email protected]"}
]
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.8"
dependencies = [
    "numpy>=1.21.0,<1.24.0",
    "torch==2.4.1",
    "torchvision>=0.9.1",
    "imageio",
    "imageio-ffmpeg",
    "matplotlib",
    "configargparse",
    "tensorboard>=2.0",
    "tqdm",
    "opencv-python",
]

[project.optional-dependencies]
dev = [
    "pytest",
    "black",
    "flake8",
    "mypy",
]
docs = [
    "sphinx",
    "sphinx-rtd-theme",
]

[project.scripts]
train = "python run_nerf.py"
download-data = "bash download_example_data.sh"
test-lego = "python run_nerf.py --config configs/lego.txt"
test-fern = "python run_nerf.py --config configs/fern.txt"
render-only = "python run_nerf.py --render_only"

# [build-system]
# requires = ["hatchling"]
# build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = [
    "pytest",
    "black",
    "flake8",
    "mypy",
]
# lockfile = "uv.lock"
# python = "3.9"

[tool.black]
line-length = 88
target-version = ['py37']
include = '\.pyi?$'
extend-exclude = '''
/(
  # directories
  \.eggs
  | \.git
  | \.hg
  | \.mypy_cache
  | \.tox
  | \.venv
  | build
  | dist
)/
'''

[tool.flake8]
max-line-length = 88
extend-ignore = ["E203", "W503"]
exclude = [
    ".git",
    "__pycache__",
    "build",
    "dist",
    ".venv",
    ".eggs",
    "*.egg",
]

[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = "-v --tb=short" 

Added information about the fork for M1 chip compatibility.
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

Successfully merging this pull request may close these issues.

2 participants