facebookresearch / facebookresearch/SlowFast
Is it possible to just use pre-trained model without GPU
- Dominant language
- Python
- Stars
- 7.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
```
def build_model(cfg):
"""
Builds the video model.
Args:
cfg (configs): configs that contains the hyper-parameters to build the
backbone. Details can be seen in slowfast/config/defaults.py.
"""
assert (
cfg.MODEL.ARCH in _MODEL_TYPES.keys()
), "Model type '{}' not supported".format(cfg.MODEL.ARCH)
assert (
cfg.NUM_GPUS <= torch.cuda.device_count()
), "Cannot use more GPU devices than available"
# Construct the model
model = _MODEL_TYPES[cfg.MODEL.ARCH](cfg)
# Determine the GPU used by the current process
cur_device = torch.cuda.current_device()
# Transfer the model to the current GPU device
model = model.cuda(device=cur_device)
# Use multi-process data parallel model in the multi-gpu setting
if cfg.NUM_GPUS > 1:
# Make model replica operate on the current device
model = torch.nn.parallel.DistributedDataParallel(
module=model, device_ids=[cur_device], output_device=cur_device
)
return model
```
I feel this project very intriguing But it seems like very sparse documentation.
I wanted to use the pre-trained SlowFast R-50 model but from the above code looks like to load the model I need GPU?
Contributor guide
Assessment
This issue has not been assessed yet.