Registry / ai-ml / pytorchcv

pytorchcv

JSON →
library0.0.74pypypi✓ verified 86d ago

PyTorchCV provides a collection of computer vision models (classification, segmentation, detection, etc.) for PyTorch, with pretrained weights. Current version 0.0.74, release cadence is irregular. Requires Python >=3.10.

pip install pytorchcv
INSTALL
IMPORT
SIG · PYTORCHCV
P
pytorchcv
ai-mlpythonv0.0.74
Install
58.8s avg
Import
11950ms
Disk
2016MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.0.67 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 97.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 58.8s · import 9.560s · 4812.8MB
2016MB installed
● package 2016MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

get_model
from pytorchcv.model_provider import get_model
get_model is the primary function to load any model by name.

Quickstart: load a pretrained ResNet-18 model and run inference on a random tensor.

import torch from pytorchcv.model_provider import get_model model = get_model('resnet18', pretrained=True) model.eval() x = torch.randn(1, 3, 224, 224) with torch.no_grad(): out = model(x) print(out.shape)
Debug
Known issues
gotchaModel names are case-sensitive and must match exactly the keys in model_provider (e.g., 'resnet18' works, 'ResNet18' does not).
fix
Use lowercase names; check available models via pytorchcv.model_provider.get_model_list().
affects: all
deprecatedSome older model APIs (e.g., direct import of model classes from pytorchcv.models) may be deprecated in future releases. Use get_model() for future compatibility.
fix
Replace direct class imports with get_model('model_name').
affects: >=0.0.50
gotchaPretrained weights download from a remote server; if the server is down or slow, model loading may fail or hang. There is no fallback or mirror.
fix
Set environment variable PYTORCHCV_CACHE_DIR to customize cache location; consider pre-downloading weights.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pytorchcv'
Package not installed or installed in wrong environment.
fix
Run: pip install pytorchcv
KeyError: 'resnet18'
Using incorrect model name (case or spelling).
fix
Check list of models: from pytorchcv.model_provider import get_model_list; print(get_model_list())
AttributeError: 'NoneType' object has no attribute 'shape'
Model returned None because pretrained weights failed to load (network issue).
fix
Ensure internet connection or set pretrained=False to load architecture without weights.
Upgrade
Version history
0.0.74latest on PyPI · released Jan 13, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
pytorchcv — pip install pytorchcv · libregistry