Yes, nothing fundamental has changed about MyBinder.org. Because the focus of one of the underlying tools, repo2docker, is to not require understanding Docker, Dockerfiles are to be avoided at all costs. Hence, my push towards using environment.yml which will weather updates to the all the tech behind MyBinder/Jupyter better than a Dockerfile. However, you’ve left your Dockerfile ‘as-is’ essentially and not followed what @sgibson91 and I advised about fixing your Dockerfile if you want to stick with the Dockerfile. I did follow the advice and build & launches using this Dockerfile placed in
binder directory work fine. (The tutorial notebook doesn’t quite run, but at least a launch is working.) You can check out an active sessions from this launch URL:
I created that Dockerfile by just appending the main content of the minimal example indicated by @sgibson91 to the end of yours.
For the tutorial notebook to work:
Use this launch URL to use the tutorial notebook:
For that launch URL to work, I needed to alter the Dockerfile further so that the build copies the notebook to the working directory that is present on launches from MyBInder, instead of just the place you have the Dockerfile installing the repo contents. Additionally, I changed the Dockerfile to using
apt-get to avoid a message about
apt not having a CLI interface.
(I realized the use of the dockerfile obviates the use of a
start file, which was my original avenue of adding the tutorial notebook and a big reason why I had several commits before realizing only those changes I just detailed above were needed.)
Note the first two cells of the tutorial notebook work now. The third cell has an issue with
torch.hub.download_url_to_file() and says:
ImportError: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
I think that cell could easily be replaced with the following:
# Download COCO val
!curl -L https://ultralytics.com/assets/coco2017val.zip -o tmp.zip
!unzip -q tmp.zip -d ../datasets && rm tmp.zip
So you’d need a slightly different version of the notebook to get placed in the sessions launched via MyBinder.org. I’d put one in the
binder directory and then copy that one instead. However, you may wish to not have two notebooks to deal with and want to fix that cell using
sed in the Dockerfile in the
binder directory & so I’ll leave that to you to decide how you want to approach that. Especially since the cell following that,
!python val.py ... to run YOLOv5x on COCO val, also fails due to shared memory resources, it seems. In other words, you may need to offer a simpler demonstration inside sessions launched via MyBinder.org so that it works with the more limited resources.