<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>wigum::website - Deep Learning</title>
    <subtitle>William Guimont-Martin’s research in robotics, AI, and 3D perception, alongside software projects, technical articles, papers, and creative writing.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://willguimont.com/tags/deep-learning/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://willguimont.com/"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2025-10-13T00:00:00+00:00</updated>
    <id>https://willguimont.com/tags/deep-learning/atom.xml</id>
    <entry xml:lang="en">
        <title>SilvaScenes</title>
        <published>2025-10-13T00:00:00+00:00</published>
        <updated>2025-10-13T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/silvascenes/"/>
        <id>https://willguimont.com/blog/silvascenes/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/silvascenes/">&lt;p&gt;Co-authored paper: &lt;a class=&quot;external&quot; href=&quot;https://arxiv.org/abs/2510.09458&quot; target=&quot;_blank&quot;&gt;SilvaScenes: Tree Segmentation and Species Classification from Under-Canopy Images in Natural Forests&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Interest in robotics for forest management is growing, but perception in complex, natural environments remains a significant hurdle. Conditions such as heavy occlusion, variable lighting, and dense vegetation pose challenges to automated systems, which are essential for precision forestry, biodiversity monitoring, and the automation of forestry equipment. These tasks rely on advanced perceptual capabilities, such as detection and fine-grained species classification of individual trees. Yet, existing datasets are inadequate to develop such perception systems, as they often focus on urban settings or a limited number of species. To address this, we present SilvaScenes, a new dataset for instance segmentation of tree species from under-canopy images. Collected across five bioclimatic domains in Quebec, Canada, SilvaScenes features 1476 trees from 24 species with annotations from forestry experts. We demonstrate the relevance and challenging nature of our dataset by benchmarking modern deep learning approaches for instance segmentation. Our results show that, while tree segmentation is easy, with a top mean average precision (mAP) of 67.65%, species classification remains a significant challenge with an mAP of only 35.69%. Our dataset and source code will be available at &lt;a rel=&quot;external&quot; href=&quot;https://github.com/norlab-ulaval/SilvaScenes&quot;&gt;this https URL&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Using Citizen Science Data for UAV Image Analysis</title>
        <published>2025-04-09T00:00:00+00:00</published>
        <updated>2025-04-09T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/citizen-sciences/"/>
        <id>https://willguimont.com/blog/citizen-sciences/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/citizen-sciences/">&lt;p&gt;Co-authored paper in MDPI: &lt;a class=&quot;external&quot; href=&quot;https://www.mdpi.com/1999-4907/16/4/616&quot; target=&quot;_blank&quot;&gt;Using Citizen Science Data as Pre-Training for Semantic Segmentation of High-Resolution UAV Images for Natural Forests Post-Disturbance Assessment&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The ability to monitor forest areas after disturbances is key to ensure their regrowth. Problematic situations that are detected can then be addressed with targeted regeneration efforts. However, achieving this with automated photo interpretation is problematic, as training such systems requires large amounts of labeled data. To this effect, we leverage citizen science data (iNaturalist) to alleviate this issue. More precisely, we seek to generate pre-training data from a classifier trained on selected exemplars. This is accomplished by using a moving-window approach on carefully gathered low-altitude images with an Unmanned Aerial Vehicle (UAV), WilDReF-Q (Wild Drone Regrowth Forest—Quebec) dataset, to generate high-quality pseudo-labels. To generate accurate pseudo-labels, the predictions of our classifier for each window are integrated using a majority voting approach. Our results indicate that pre-training a semantic segmentation network on over 140,000 auto-labeled images yields an $F1$ score of 43.74% over 24 different classes, on a separate ground truth dataset. In comparison, using only labeled images yields a score of 32.45%, while fine-tuning the pre-trained network only yields marginal improvements (46.76%). Importantly, we demonstrate that our approach is able to benefit from more unlabeled images, opening the door for learning at scale. We also optimized the hyperparameters for pseudo-labeling, including the number of predictions assigned to each pixel in the majority voting process. Overall, this demonstrates that an auto-labeling approach can greatly reduce the development cost of plant identification in regeneration regions, based on UAV imagery.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Terrain Classification for Boreal Forests</title>
        <published>2024-09-10T00:00:00+00:00</published>
        <updated>2024-09-10T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/borealtc/"/>
        <id>https://willguimont.com/blog/borealtc/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/borealtc/">&lt;p&gt;Co-authored paper at IROS 2024: &lt;a class=&quot;external&quot; href=&quot;https://norlab-ulaval.github.io/BorealTC/&quot; target=&quot;_blank&quot;&gt;Proprioception Is All You Need: Terrain Classification for Boreal Forests&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Recent works in field robotics highlighted the importance of resiliency against different types of terrains. Boreal forests, in particular, are home to many mobility-impeding terrains that should be considered for off-road autonomous navigation. Also, being one of the largest land biomes on Earth, boreal forests are an area where autonomous vehicles are expected to become increasingly common. In this paper, we address the issue of classifying boreal terrains by introducing BorealTC, a publicly available dataset for proprioceptive-based terrain classification (TC). Recorded with a Husky A200, our dataset contains 116 min of Inertial Measurement Unit (IMU), motor current, and wheel odometry data, focusing on typical boreal forest terrains, notably snow, ice, and silty loam. Combining our dataset with another dataset from the literature, we evaluate both a Convolutional Neural Network (CNN) and the novel state space model (SSM)-based Mamba architecture on a TC task. We show that while CNN outperforms Mamba on each separate dataset, Mamba achieves greater accuracy when trained on a combination of both. In addition, we demonstrate that Mamba’s learning capacity is greater than a CNN for increasing amounts of data. We show that the combination of two TC datasets yields a latent space that can be interpreted with the properties of the terrains. We also discuss the implications of merging datasets on classification. Our source code and dataset are &lt;a class=&quot;external&quot; href=&quot;https://github.com/norlab-ulaval/BorealTC&quot; target=&quot;_blank&quot;&gt;publicly available online&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Benchmarking of Real-Time Object Detection Models</title>
        <published>2024-06-05T00:00:00+00:00</published>
        <updated>2024-06-05T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/det-bench/"/>
        <id>https://willguimont.com/blog/det-bench/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/det-bench/">&lt;p&gt;Published a paper to ArXiv: &lt;a class=&quot;external&quot; href=&quot;https://arxiv.org/abs/2405.06911&quot; target=&quot;_blank&quot;&gt;Replication Study and Benchmarking of Real-Time Object Detection Models&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This work examines the reproducibility and benchmarking of state-of-the-art real-time object detection models. As object detection models are often used in real-world contexts, such as robotics, where inference time is paramount, simply measuring models’ accuracy is not enough to compare them. We thus compare a large variety of object detection models’ accuracy and inference speed on multiple graphics cards. In addition to this large benchmarking attempt, we also reproduce the following models from scratch using PyTorch on the MS COCO 2017 dataset: DETR, RTMDet, ViTDet and YOLOv7. More importantly, we propose a unified training and evaluation pipeline, based on MMDetection’s features, to better compare models. Our implementation of DETR and ViTDet could not achieve accuracy or speed performances comparable to what is declared in the original papers. On the other hand, reproduced RTMDet and YOLOv7 could match such performances. Studied papers are also found to be generally lacking for reproducibility purposes. As for MMDetection pretrained models, speed performances are severely reduced with limited computing resources (larger, more accurate models even more so). Moreover, results exhibit a strong trade-off between accuracy and speed, prevailed by anchor-free models - notably RTMDet or YOLOx models. The code used is this paper and all the experiments is available in the repository at &lt;a class=&quot;external&quot; href=&quot;https://github.com/willGuimont/segdet_mlcr2024&quot; target=&quot;_blank&quot;&gt;this https URL&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>RandAugment</title>
        <published>2024-04-03T00:00:00+00:00</published>
        <updated>2024-04-03T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/randaugment/"/>
        <id>https://willguimont.com/blog/randaugment/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/randaugment/">&lt;p&gt;Presentation made for the course &lt;a class=&quot;external&quot; href=&quot;https://www.ulaval.ca/etudes/cours/gif-7010-avancees-en-apprentissage-automatique&quot; target=&quot;_blank&quot;&gt;GIF-7010: Avancées en apprentissage automatique&lt;/a&gt; at Université Laval on &lt;a class=&quot;external&quot; href=&quot;https://arxiv.org/abs/1909.13719&quot; target=&quot;_blank&quot;&gt;RandAugment&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are the slides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;RandAugment.pptx&quot; target=&quot;_blank&quot;&gt;RandAugment.pptx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;RandAugment.pdf&quot; target=&quot;_blank&quot;&gt;RandAugment.pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Segment Anything</title>
        <published>2024-02-21T00:00:00+00:00</published>
        <updated>2024-02-21T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/segment-anything/"/>
        <id>https://willguimont.com/blog/segment-anything/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/segment-anything/">&lt;p&gt;Presentation made for the course &lt;a class=&quot;external&quot; href=&quot;https://www.ulaval.ca/etudes/cours/gif-7010-avancees-en-apprentissage-automatique&quot; target=&quot;_blank&quot;&gt;GIF-7010: Avancées en apprentissage automatique&lt;/a&gt; at Université Laval on &lt;a class=&quot;external&quot; href=&quot;https://arxiv.org/abs/2304.02643&quot; target=&quot;_blank&quot;&gt;Segment Anything&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are the slides:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;SegmentAnything.pptx&quot; target=&quot;_blank&quot;&gt;Segment Anything.pptx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;SegmentAnything.pdf&quot; target=&quot;_blank&quot;&gt;Segment Anything.pdf&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>MaskBEV</title>
        <published>2023-07-11T00:00:00+00:00</published>
        <updated>2023-07-11T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/maskbev/"/>
        <id>https://willguimont.com/blog/maskbev/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/maskbev/">&lt;p&gt;Accepted paper at IROS 2023: &lt;a class=&quot;external&quot; href=&quot;https://arxiv.org/abs/2307.01864&quot; target=&quot;_blank&quot;&gt;MaskBEV: Joint Object Detection and Footprint Completion for Bird’s-eye View 3D Point Clouds&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Recent works in object detection in LiDAR point clouds mostly focus on predicting bounding boxes around objects. This prediction is commonly achieved using anchor-based or anchor-free detectors that predict bounding boxes, requiring significant explicit prior knowledge about the objects to work properly. To remedy these limitations, we propose MaskBEV, a bird’s-eye view (BEV) mask-based object detector neural architecture. MaskBEV predicts a set of BEV instance masks that represent the footprints of detected objects. Moreover, our approach allows object detection and footprint completion in a single pass. MaskBEV also reformulates the detection problem purely in terms of classification, doing away with regression usually done to predict bounding boxes. We evaluate the performance of MaskBEV on both SemanticKITTI and KITTI datasets while analyzing the architecture advantages and limitations.&lt;/p&gt;
&lt;/blockquote&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Learn Transformers</title>
        <published>2023-03-23T00:00:00+00:00</published>
        <updated>2023-03-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/transformers/"/>
        <id>https://willguimont.com/blog/transformers/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/transformers/">&lt;p&gt;Here’s a small library I made to explain the Transformer architecture in PyTorch: &lt;a class=&quot;external&quot; href=&quot;https://github.com/willGuimont/transformers&quot; target=&quot;_blank&quot;&gt;willGuimont/transformers&lt;/a&gt;.
The code is heavily commented and should be easy to follow.&lt;/p&gt;
&lt;p&gt;This repository also contains some popular transformer-based models, such as Vision Transformer.&lt;/p&gt;
&lt;p&gt;This was made while developping new practical exercises for &lt;a class=&quot;external&quot; href=&quot;https://github.com/ulaval-damas/glo4030-labs&quot; target=&quot;_blank&quot;&gt;GLO-7030 at Université Laval&lt;/a&gt;.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>torch_waymo</title>
        <published>2023-02-02T00:00:00+00:00</published>
        <updated>2023-02-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/torch-waymo/"/>
        <id>https://willguimont.com/blog/torch-waymo/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/torch-waymo/">&lt;p&gt;Here’s a small library I made to use the &lt;a class=&quot;external&quot; href=&quot;https://waymo.com/open/&quot; target=&quot;_blank&quot;&gt;Waymo Open Dataset&lt;/a&gt; in PyTorch, without any dependency to Tensorflow: &lt;a class=&quot;external&quot; href=&quot;https://github.com/willGuimont/torch_waymo&quot; target=&quot;_blank&quot;&gt;willGuimont/torch_waymo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here’s the corresponding PyPI package: &lt;a class=&quot;external&quot; href=&quot;https://pypi.org/project/torch-waymo/&quot; target=&quot;_blank&quot;&gt;torch-waymo&lt;/a&gt;.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Apprentissage profonds sur les nuages de points 3D</title>
        <published>2022-09-12T00:00:00+00:00</published>
        <updated>2022-09-12T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/nn-on-pc-ift-6001/"/>
        <id>https://willguimont.com/blog/nn-on-pc-ift-6001/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/nn-on-pc-ift-6001/">&lt;p&gt;Papier réalisé pour le cours IFT-6001 @ Université Laval sur l’apprentissage par réseaux de neurones profonds sur les nuages de points 3D: &lt;a href=&quot;ApprentissageParReseauxDeNeuronesProfondsSurLesNuagesDePoints3D.pdf&quot; target=&quot;_blank&quot;&gt;Apprentissage par réseaux de neurones profonds sur les nuages de points 3D&lt;/a&gt;&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Point-BERT IFT-6001</title>
        <published>2022-04-28T00:00:00+00:00</published>
        <updated>2022-04-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/point-bert-ift-6001/"/>
        <id>https://willguimont.com/blog/point-bert-ift-6001/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/point-bert-ift-6001/">&lt;p&gt;Voici une présentation que j’ai donnée le 28 avril 2022 pour le cours &lt;a class=&quot;external&quot; href=&quot;https://www.ulaval.ca/etudes/cours/ift-6001-introduction-a-la-recherche-en-informatique-communication-et-methodologie&quot; target=&quot;_blank&quot;&gt;IFT-6001 Introduction à la recherche en informatique : communication et méthodologie&lt;/a&gt; à l’Université Laval sur &lt;a class=&quot;external&quot; href=&quot;https://arxiv.org/abs/2111.14819&quot; target=&quot;_blank&quot;&gt;Point-BERT&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Voici les diapositives: &lt;a href=&quot;Point-BERT-IFT-6001.pdf&quot; target=&quot;_blank&quot;&gt;Point-BERT&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Voici l’enregistrement de la présentation:&lt;/p&gt;
&lt;iframe
	class=&quot;youtube-embed&quot;
	src=&quot;https://www.youtube-nocookie.com/embed/fywySHYLzW4&quot;
	allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot;
	referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen&gt;
&lt;/iframe&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Compute Canada Quickstart</title>
        <published>2022-01-28T00:00:00+00:00</published>
        <updated>2022-01-28T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/compute-canada/"/>
        <id>https://willguimont.com/blog/compute-canada/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/compute-canada/">&lt;p&gt;Here’s a small guide on how to use Compute Canada clusters to train deep learning models.&lt;/p&gt;
&lt;p&gt;In this guide, we’ll do the necessary setup to get you up and running on a cluster. This guide is written to work with &lt;a class=&quot;external&quot; href=&quot;https://docs.computecanada.ca/wiki/Narval/en&quot; target=&quot;_blank&quot;&gt;Narval&lt;/a&gt;, but it should be easy to adapt it to other clusters by changing the URLs. You can see available clusters at &lt;a class=&quot;external&quot; href=&quot;https://www.computecanada.ca/research-portal/accessing-resources/available-resources/&quot; target=&quot;_blank&quot;&gt;this URL&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We recommend Narval for deep learning as of now (2021-2022) because it has 4 NVIDIA A100 (40 Gb memory) per node.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;This guide was written by William Guimont-Martin, 2021&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Also available on &lt;a class=&quot;external&quot; href=&quot;https://github.com/norlab-ulaval/Norlab_wiki/wiki/Compute-Canada-Quickstart&quot; target=&quot;_blank&quot;&gt;Norlab Wiki&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&quot;account-creation&quot;&gt;Account creation&lt;/h2&gt;
&lt;p&gt;First of all, you’ll need a Compute Canada account to access the clusters. To do so, please see &lt;a class=&quot;external&quot; href=&quot;https://docs.google.com/document/d/1fk0P_4wIKaP1giUD0rtbpCtxzj3YYm797RQKklQjpuk/edit?usp=sharing&quot; target=&quot;_blank&quot;&gt;Tips for new students&lt;/a&gt;. You’ll see the URL to apply for an account and Philippe Giguère’s sponsor code.&lt;/p&gt;
&lt;p&gt;You’ll need your username and your password for the following steps.&lt;/p&gt;
&lt;h2 id=&quot;ssh-and-ssh-copy-id&quot;&gt;SSH and &lt;code&gt;ssh-copy-id&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;To access Compute Canada’s clusters, you’ll need to ssh into them. You can get the login node URL by checking the cluster’s wiki page. For Narval, the URL is &lt;strong&gt;narval.computecanada.ca&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;To connect to the cluster:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; replace &amp;lt;username&amp;gt; with your actual Compute Canada username&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;ssh&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;usernam&lt;/span&gt;&lt;span&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;@narval.computecanada.ca&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You’ll be asked to enter your password. If everything goes right, you’ll be greeted by the cluster’s welcome message.&lt;/p&gt;
&lt;p&gt;To make things easier later, we recommend to set up an SSH key to connect to the cluster.&lt;/p&gt;
&lt;p&gt;To do so, you’ll need to generate an SSH key &lt;a class=&quot;external&quot; href=&quot;https://docs.github.com/en/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys&quot; target=&quot;_blank&quot;&gt;if you don’t already have one you’d like to use&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please see &lt;a class=&quot;external&quot; href=&quot;https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent&quot; target=&quot;_blank&quot;&gt;Generating a new SSH key and adding it to the ssh-agent&lt;/a&gt; from GitHub to generate a new SSH key.&lt;/p&gt;
&lt;p&gt;Once you have added your SSH key and added it to the ssh-agent, copy your key to the cluster with&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; replace &amp;lt;username&amp;gt; with your actual Compute Canada username&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;ssh-copy-id&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;usernam&lt;/span&gt;&lt;span&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;@narval.computecanada.ca&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If everything went right, you should now be able to ssh into your cluster without being asked your password.&lt;/p&gt;
&lt;h2 id=&quot;clone-your-code&quot;&gt;Clone your code&lt;/h2&gt;
&lt;p&gt;Now that you are logged in the cluster, you should have a bash shell. From that shell, you can use most Linux commands you’re used to like &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cd&lt;/code&gt;, etc..&lt;/p&gt;
&lt;p&gt;We’ll now clone your project on the cluster.&lt;/p&gt;
&lt;p&gt;From the cluster, you can create another SSH key and &lt;a class=&quot;external&quot; href=&quot;https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account&quot; target=&quot;_blank&quot;&gt;add it to GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This will allow you to &lt;code&gt;git clone&lt;/code&gt; your repository into your home directory.&lt;/p&gt;
&lt;h2 id=&quot;setup-your-python-venv&quot;&gt;Setup your Python venv&lt;/h2&gt;
&lt;p&gt;It is recommended to create your Python venv from inside a SLURM job, if your installation script is quite complex, it will be easier to set up before starting any job.&lt;/p&gt;
&lt;p&gt;To create a Python venv:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; python/3.8.10&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; loads python, you can change the version, you can see available versions using &amp;quot;module avail python&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;python&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;m&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; venv&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; venv&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; creates a virtual environment in the folder ./venv/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once created, you can activate it using:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; venv/bin/activate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should now see &lt;code&gt;(venv)&lt;/code&gt; at the beginning of your shell prompt.&lt;/p&gt;
&lt;p&gt;You can now &lt;code&gt;pip&lt;/code&gt; install all of your dependencies.&lt;/p&gt;
&lt;p&gt;Please note that when installing mmdetection and its dependencies, you might need to also run:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;pip&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; install&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; numpy&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;pip&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; install&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;U&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; scikit-learn&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you want to create your venv from inside a job, note the commands you did to setup your environment and copy them into your job script.&lt;/p&gt;
&lt;h2 id=&quot;putting-your-data-on-the-cluster&quot;&gt;Putting your data on the cluster&lt;/h2&gt;
&lt;p&gt;To put your data on the cluster, we recommend using &lt;code&gt;sftp&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;First of all, take the time to familiarize yourself with &lt;a class=&quot;external&quot; href=&quot;https://docs.computecanada.ca/wiki/Storage_and_file_management/en#Storage_types&quot; target=&quot;_blank&quot;&gt;the different types of storage available on the clusters&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;From that, you’ll have to upload your dataset in &lt;code&gt;~/projects/def-philg/&amp;lt;username&amp;gt;&lt;/code&gt;. Note that this space is shared across the people in the lab. Please keep it clean!&lt;/p&gt;
&lt;p&gt;From you local computer:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; path/to/your/dataset/on/your/computer&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; replace &amp;lt;username&amp;gt; with your actual Compute Canada username&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;sftp&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;usernam&lt;/span&gt;&lt;span&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;@narval.computecanada.ca&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;sftp&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; ~/projects/def-philg/&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;usernam&lt;/span&gt;&lt;span&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; use &amp;quot;put file&amp;quot; to upload a file, use &amp;quot;get file&amp;quot; to download a file&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; you can use * to wildcard select multiple files&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you are using mmdetection, you might want to add a symlink to your data in &lt;code&gt;code/data&lt;/code&gt;. To do so, run the following commands:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; to/your/code/folder&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change this path&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;mkdir&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; data&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;ln&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; path/to/your/dataset&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; &amp;lt;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;dataset-nam&lt;/span&gt;&lt;span&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change path and dataset name&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;slurm-jobs&quot;&gt;SLURM jobs&lt;/h2&gt;
&lt;p&gt;We can now create jobs. To do so, create a .sh file and paste the following inside:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#!&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --gres=gpu:4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --cpus-per-task=8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --mem=40000M&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --time=1-00:00&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --job-name=01_baseline_pointpillars&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --output=%x-%j.out&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Variables&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt; OMP_NUM_THREADS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;SLURM_CPUS_PER_TASK&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt; MAKEFLAGS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;-j&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;nproc&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Modules&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; cuda/11.0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; python/3.8.10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; qt/5.12.8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; geos&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; llvm/8.0.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Setup Python&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; ~/venv/bin/activate&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Start task&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change that part to how you run your python script, this example shows how to do multi GPU training using mmdetection3d&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; to/your/code/folder&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change this path&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;CONFIG_FILE&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;WORK_DIR&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change this path too&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;GPUS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;./dist_train.sh&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;CONFIG_FILE&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;GPUS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;-work-dir&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;WORK_DIR&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;-cfg-options&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; cudnn_benchmark=True&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; evaluation.gpu_collect=True&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; gpu_collect=True is essential to do multi GPU training&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Cleaning up&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;deactivate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This script is organized in five main parts.&lt;/p&gt;
&lt;h3 id=&quot;configure-job&quot;&gt;Configure job&lt;/h3&gt;
&lt;p&gt;This part is used to configure the resources needed for your job.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#!&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --gres=gpu:4                         # Ask for 4 GPU&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --cpus-per-task=8                    # Ask for 8 CPU&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --mem=40000M                         # Ask for 40 000M of RAM&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --time=1-00:00                       # Run for DD-HH:MM&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --job-name=01_baseline_pointpillars  # Job name&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;SBATCH --output=%x-%j.out                   # Log will be written to f&amp;#39;{job_name}_{job_id}&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;setup-installation&quot;&gt;Setup installation&lt;/h3&gt;
&lt;p&gt;This part sets environment variables for multithreading and loads needed modules. You might need to change the loaded versions.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Variables&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt; OMP_NUM_THREADS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;SLURM_CPUS_PER_TASK&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-3 z-l-b z-d-6 z-d-b&quot;&gt;export&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt; MAKEFLAGS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;-j&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;nproc&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Modules&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; cuda/11.0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; python/3.8.10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; qt/5.12.8&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; geos&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;module&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; load&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; llvm/8.0.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;loading-the-venv&quot;&gt;Loading the venv&lt;/h3&gt;
&lt;p&gt;This will load the venv we created earlier&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Setup Python&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;source&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; ~/venv/bin/activate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;running-your-actual-code&quot;&gt;Running your actual code&lt;/h3&gt;
&lt;p&gt;You will need to change this part to run what you want to run. This scripts shows how to use multi-GPU with mmdetection3d.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Start task&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change that part to how you run your python script, this example shows how to do multi GPU training using mmdetection3d&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;cd&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; to/your/code/folder&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change this path&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;CONFIG_FILE&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;_&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;s&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;WORK_DIR&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;t&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;k&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;r&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; TODO change this path too&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;GPUS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt;4&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;./dist_train.sh&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;CONFIG_FILE&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;GPUS&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;-work-dir&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt; $&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;WORK_DIR&lt;/span&gt;&lt;span class=&quot;z-l-5 z-d-5&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;z-l-8 z-d-8&quot;&gt;-cfg-options&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; cudnn_benchmark=True&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; evaluation.gpu_collect=True&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;  #&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; gpu_collect=True is essential to do multi GPU training&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&quot;cleaning-up&quot;&gt;Cleaning up&lt;/h3&gt;
&lt;p&gt;Not strictly needed, but it is always a good thing to clean up after yourself.&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;z-l-6 z-l-i z-d-3 z-d-i&quot;&gt; Cleaning up&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;deactivate&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&quot;run-the-job&quot;&gt;Run the job&lt;/h2&gt;
&lt;p&gt;To run a job, you first have to queue it to the job scheduler. To do so, run the following command:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;sbatch&lt;/span&gt;&lt;span class=&quot;z-l-2 z-d-2&quot;&gt; script.sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can then verify the job is queued by running:&lt;/p&gt;
&lt;pre class=&quot;giallo z-l-code z-d-code&quot; &gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-l-1 z-d-1&quot;&gt;sq&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;More information is available &lt;a class=&quot;external&quot; href=&quot;https://docs.computecanada.ca/wiki/Running_jobs&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&quot;useful-tools&quot;&gt;Useful tools&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;sbatch&lt;/code&gt;: queue a job.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sq&lt;/code&gt;: view your queued jobs&lt;/p&gt;
&lt;p&gt;&lt;code&gt;scancel &amp;lt;id&amp;gt;&lt;/code&gt;: cancel job with id &lt;id&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;salloc --account=def-philg --gres=gpu:2 --cpus-per-task=4 --mem=32000M --time=5:00:00&lt;/code&gt;: start an interactive job, which will allow you to test your scripts before queuing jobs&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sftp&lt;/code&gt;: useful tool to transfer data from and to the cluster&lt;/p&gt;
&lt;p&gt;&lt;code&gt;diskusage_report&lt;/code&gt;: see used disk space&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Transformers in Computer Vision</title>
        <published>2021-09-02T00:00:00+00:00</published>
        <updated>2021-09-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/transformers-in-cv/"/>
        <id>https://willguimont.com/blog/transformers-in-cv/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/transformers-in-cv/">&lt;p&gt;On September 2nd 2021, I gave a talk on transformer-based neural network architectures for computer vision. I gave the in University Laval’s &lt;a class=&quot;external&quot; href=&quot;https://norlab.ulaval.ca/&quot; target=&quot;_blank&quot;&gt;Norlab&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are the slides: &lt;a href=&quot;TransformersInComputerVision.pdf&quot; target=&quot;_blank&quot;&gt;Transformers in Computer Vision&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And here is the recording of the event:&lt;/p&gt;
&lt;iframe
	class=&quot;youtube-embed&quot;
	src=&quot;https://www.youtube-nocookie.com/embed/eaWXeXs8dh0&quot;
	allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot;
	referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen&gt;
&lt;/iframe&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>TossingBot</title>
        <published>2020-04-29T00:00:00+00:00</published>
        <updated>2020-04-29T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/tossingbot/"/>
        <id>https://willguimont.com/blog/tossingbot/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/tossingbot/">&lt;p&gt;This video presents TossingBot, a robotic arm that learns to throw arbitrary objects with residual physics.&lt;/p&gt;
&lt;p&gt;This video was made for the class &lt;em&gt;GLO-7030: Deep Learning&lt;/em&gt; at Université Laval.&lt;/p&gt;
&lt;iframe
	class=&quot;youtube-embed&quot;
	src=&quot;https://www.youtube-nocookie.com/embed/Icx6j3s_Pmc&quot;
	allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share&quot;
	referrerpolicy=&quot;strict-origin-when-cross-origin&quot; allowfullscreen&gt;
&lt;/iframe&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>On Learning</title>
        <published>2020-01-23T00:00:00+00:00</published>
        <updated>2020-01-23T00:00:00+00:00</updated>
        
        <author>
          <name>
            William Guimont-Martin
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://willguimont.com/blog/on-learning/"/>
        <id>https://willguimont.com/blog/on-learning/</id>
        
        <content type="html" xml:base="https://willguimont.com/blog/on-learning/">&lt;p&gt;This is just some rambles on learning…&lt;/p&gt;
&lt;p&gt;I’m currently taking a class on deep neural networks. In the first class, we discussed multiple ways to have artificial intelligence systems.&lt;/p&gt;
&lt;p&gt;One way would be to code hand-designed programs to accomplish the task. &lt;code&gt;If&lt;/code&gt; something happens, &lt;code&gt;then&lt;/code&gt; the system does that, &lt;code&gt;else if&lt;/code&gt; this other thing happens, &lt;code&gt;then&lt;/code&gt; do this, &lt;code&gt;else if&lt;/code&gt;… We can achieve great things using rule-based programs, but on more complex tasks we would need a lot of cases to handle a lot of different cases.&lt;/p&gt;
&lt;p&gt;Another way would be to make the computer learn from the data. So we analyze the data, find features for the system to learn from, then use classical machine learning algorithms such as SVM. Again, for complex tasks, we may miss some useful feature to correctly learn from the data.&lt;/p&gt;
&lt;p&gt;The next step is to make the algorithm find features by itself. This is what neural networks do. Each layer of a deep neural network extract features for the higher layers to “reason” about. The classical example is a neural network that detects faces. The first layers might detect very simple patterns like edges. Higher up, a layer might detect corners and contours. Layers at the end of the network might detect complex object parts used by the final layer to classify the object. This is what is called representation learning, the artificial intelligence system finds a way of representing the data so that it is easy to solve the task.&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-Goodfellow-1&quot;&gt;&lt;a href=&quot;https://willguimont.com/blog/on-learning/#fn-Goodfellow&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;A good way of visualizing the different takes on artificial intelligence is from the book Deep Learning&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-Goodfellow-2&quot;&gt;&lt;a href=&quot;https://willguimont.com/blog/on-learning/#fn-Goodfellow&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;.
&lt;img src=&quot;https://willguimont.com/blog/on-learning/types.webp&quot; alt=&quot;Types of learning&quot; loading=&quot;lazy&quot; decoding=&quot;async&quot; /&gt;&lt;/p&gt;
&lt;h2 id=&quot;dreyfus&quot;&gt;Dreyfus&lt;/h2&gt;
&lt;p&gt;When I learned about representation learning, it got me thinking about how we learn and the Dreyfus model&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-Dreyfus-1&quot;&gt;&lt;a href=&quot;https://willguimont.com/blog/on-learning/#fn-Dreyfus&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;
&lt;p&gt;I think we can draw links between the Novice stage and rule-based systems. In this first stage of the Dreyfus model, the learner relies on rules to determine the action.&lt;/p&gt;
&lt;p&gt;Perhaps, there are other links between machine learning and the Dreyfus model.&lt;/p&gt;
&lt;h2 id=&quot;mental-representations&quot;&gt;Mental representations&lt;/h2&gt;
&lt;p&gt;In The Sciences of the artificial&lt;sup class=&quot;footnote-reference&quot; id=&quot;fr-Simon-1&quot;&gt;&lt;a href=&quot;https://willguimont.com/blog/on-learning/#fn-Simon&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt; from Herbert A. Simon, the author discusses the experience of A. de Groot and al. on chess perception. They showed chessboard with pieces in positions of real games for 5 seconds, then removed the pieces. Then they asked the subjects to put the pieces back in their position.&lt;/p&gt;
&lt;p&gt;As you might guess, somebody not accustomed to chess would have a pretty hard time to reconstruct the positions. For grandmasters and masters though, they were able to reconstruct the positions with almost no error!&lt;/p&gt;
&lt;p&gt;They then retried the experiment with &lt;em&gt;random&lt;/em&gt; piece positions. In that case, even grandmasters could not reconstruct the board.&lt;/p&gt;
&lt;p&gt;This shows that a grandmaster or a master built a good mental &lt;em&gt;representation&lt;/em&gt; of the game. Instead of memorizing all pieces, they memorized relations between pieces, which allow them to memorize them more easily.&lt;/p&gt;
&lt;p&gt;So, when I learned about representation learning, this reminded me of that particular example. Under the hood, a neural network &lt;em&gt;tries&lt;/em&gt; to do exactly what the grandmaster did, build a good representation of the problem to solve. Once the representation is built, a simple linear layer can solve the problem!&lt;/p&gt;
&lt;p&gt;I think this is what is really going on when humans learn. All the studying isn’t about memorizing facts or formulas, it’s about building a good mental representation that can be used to solve many problems. Once you understand basic algebra, you can use that framework to solve many problems you weren’t trained on.&lt;/p&gt;
&lt;p&gt;In a neural network, we are usually not concerned about memorizing all the input data, instead, we want to generalize to unseen examples.&lt;/p&gt;
&lt;p&gt;Perhaps we should tell students that they aren’t in school to memorize facts, but instead to build a toolbox of mental representations to help them in life. Our brain is a neural network that needs to be trained with great care!&lt;/p&gt;
&lt;h2 id=&quot;sources&quot;&gt;Sources&lt;/h2&gt;
&lt;section class=&quot;footnotes&quot;&gt;
&lt;ol class=&quot;footnotes-list&quot;&gt;
&lt;li id=&quot;fn-Goodfellow&quot;&gt;
&lt;p&gt;Goodfellow, Ian &amp;amp; Bengio, Yoshua &amp;amp; Courville, Aaron. Deep Learning. 2016. &lt;a href=&quot;https://willguimont.com/blog/on-learning/#fr-Goodfellow-1&quot;&gt;↩&lt;/a&gt; &lt;a href=&quot;https://willguimont.com/blog/on-learning/#fr-Goodfellow-2&quot;&gt;↩2&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-Dreyfus&quot;&gt;
&lt;p&gt;Dreyfus, Stuart E. The Five-Stage Model of Adult Skill Acquisition. 2004. &lt;a href=&quot;https://willguimont.com/blog/on-learning/#fr-Dreyfus-1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id=&quot;fn-Simon&quot;&gt;
&lt;p&gt;Simon, Herbert A. The Sciences of the Artificial, 1969. &lt;a href=&quot;https://willguimont.com/blog/on-learning/#fr-Simon-1&quot;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/section&gt;
</content>
        
    </entry>
</feed>
