openai / Video-Pre-Training

Video PreTraining (VPT): Learning to Act by Watching Unlabeled Online Videos
MIT License
1.28k stars 142 forks source link

turn VPT into a python package #18

Closed verbose-void closed 2 years ago

verbose-void commented 2 years ago

refactor such that lib is now inside a parent folder vpt. also moved the demo scripts, like run_agent.py into vpt/. created a setup.py file, which you can run pip install -e vpt/ such that it's easier to use VPT from external scripts in this way:

from vpt.run_inverse_dynamics_model import get_IDM_agent

get_IDM_agent("path/to/idm.model", "path/to/idm.weights")

i know you mentioned that VPT is for demo purposes only and the code shouldn't be used elsewhere, but the model files and weight files are built so propriatarily that using them without copy pasting the code (for example IDM) is a reverse-engineering task.

instead, i figured it would be easier to turn the VPT code into a package.

i modified the README with updated information on how to run the files as well. there are no tests though, so i can't 100% guarentee everything works but i tested some of the experiments and am fairly sure it should be fine. if not it will be a trivial import fix.

verbose-void commented 2 years ago

i thought it was going to be easier to create the module and then write custom code but i'm definitely having trouble. i created another issue regarding "reverse engineering": https://github.com/openai/Video-Pre-Training/issues/19

Miffyli commented 2 years ago

Hey. Thanks for the PR!

On surface I do agree with you: it would be much easier to use this library for productive things ("building up on it") if it were a Python library. I have already had the same headache with the BASALT baselines which use this code.

However, I still leaning towards keeping this library as a non-module thing for few reasons:

So as a TL;DR, I do think making this repo a python package would be a good idea. Now, if someone makes a new repository which implements the same stuff but as a nice module/library, I am more than happy add a link to it in the readme :)

verbose-void commented 2 years ago

@Miffyli understood, thanks for the thorough response