Month: January 2024

  • What to Do When You Spill a Drink on Your Laptop

    What to Do When You Spill a Drink on Your Laptop

    If you work at a desk with a laptop, sooner or later you will probably spill a drink on it.
    I once spilled a drink on my own MacBook Pro and nearly lost the files I needed to graduate.
    So here I want to share what to do when your computer gets soaked.

    What to do right after a spill

    First of all, when you spill a drink, avoid doing anything careless like turning the computer on.

    Instead, shut the power off immediately and stand the computer up on the side where the drink was spilled, so that no more liquid seeps inside or spreads to areas that are still dry.

    Photo

    Once you have confirmed that the surface of the computer is dry (after several hours to a day), try turning it on and check its condition.

    What to do next

    Depending on the condition, there are several options.

    Coverage from the retailer or manufacturer

    Some manufacturers’ warranties include accidental damage coverage, so check whether your case qualifies.

    If you can use this kind of coverage, it is likely to be the cheapest way to get your machine back.

    With a standard manufacturer’s warranty, liquid damage is very likely to be excluded.
    That said, many manufacturers still accept repair requests, so it is worth asking for a paid repair.

    Computer repair shops

    Many computer repair shops handle water-damaged machines.

    Some also work on MacBooks, so it is well worth considering this option.

    They can also inspect the inside of your computer, so even if you only spilled a small amount and simply want peace of mind, they will check it for you.

    And if a repair is needed, they can handle a wide range of work, so the chances of recovery are very high.

    Why leaving it alone is a bad idea

    Even after a spill, a computer will often work again a day later.

    Even so, I do not recommend just leaving it at that.
    If moisture has reached the circuit board, it can cause a sudden short circuit or corrode the board.

    You often hear about machines that worked for a while after getting wet and then suddenly died, so get the computer repaired as soon as you can.

    Acting early may mean a simple cleaning is enough, and it keeps the cost down.

    What you can do in advance, just in case

    When a computer gets soaked, recovering the data is often difficult.

    For exactly that reason, back up your computer regularly.

    Computers tend to break down precisely when you need them most, such as when you are up against a thesis deadline.

    Not being able to retrieve your data at a moment like that is a serious problem.
    I have been in exactly that situation myself….

  • How to Install SLEAP [Updated February 2024]

    How to Install SLEAP [Updated February 2024]

    Here I’d like to describe how to install SLEAP, a machine learning-based tool for tracking animal body parts.

    DeepLabCut is the most widely used tracking tool, and I have written about how to install it in the past, as have many other people.

    For SLEAP, however, there are currently few articles available in Japanese.
    SLEAP has many advantages over DeepLabCut, so I decided to write up the installation procedure to make it a viable option for more people.

    SLEAP’s documentation, from installation to usage, is extremely well organized and comes with videos, so anyone comfortable with English should find it easy to get started.

    The SLEAP paper is available here

    The official SLEAP website is here

    The SLEAP GitHub repository is here

    Introduction

    First of all, regarding the approach described in the official SLEAP installation guide,

    mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.3

    which sets up the environment, installs the packages, and handles everything else in a single command: I tried this on several computers, but in every case it stalled indefinitely during the environment setup and never completed successfully.

    So here I introduce an alternative installation method, also suggested by the developers.

    Installation

    We will basically follow the installation instructions on the official SLEAP website.

    Environment

    ・Windows 11 Pro
    ・Verified on an NVIDIA 3080
    ・SLEAP 1.3.3
    ・Python 3.7.12

    Downloading the files

    First, download the files from the SLEAP GitHub repository to your computer.

    If you are using Git, run the following command.

    git clone https://github.com/talmolab/sleap

    If the git command is not available, either install git or download the files directly from GitHub.

    Installing the GPU driver

    Install the NVIDIA driver.
    (Skip this step if it is already installed.)

    Installing Anaconda

    Next, download and install the Windows 10 64-bit version from the Anaconda website.
    Click Free Download on the Anaconda site and scroll down; you should see a screen like the one below.
    Install the Windows installer on the far left.

    Once Anaconda is installed, you should find “Anaconda Prompt” in your Windows app list.
    We will use it to run the commands below to create the virtual environment, install SLEAP, and launch it.

    Creating the virtual environment and installing

    Next, run the following commands to create the virtual environment and install SLEAP.
    The environment will be named “sleap”.

    cd sleap
    conda env create -f environment.yml -n sleap

    Note that the commands above work on computers with a GPU;
    on computers without one, use the following commands instead.

    cd sleap
    conda env create -f environment_no_cuda.yml -n sleap

    That completes the installation.

    Verifying the installation

    Activate the virtual environment and launch SLEAP with sleap-label.

    conda activate sleap
    sleap-label

    You need to activate the virtual environment (the conda activate sleap command) every time you reopen Anaconda Prompt.

    After activation, the prompt should change from (base) to (sleap).

    If SLEAP launches, the installation was successful.

    Checking version information for reporting in a paper

    To check the version, activate the sleap environment and run the following command.

    python -c "import sleap; sleap.versions()"

    This will output

    SLEAP: 1.3.3
    TensorFlow: 2.7.0
    Numpy: 1.21.5
    Python: 3.7.12
    OS: Windows-10-10.0.22621-SP0

    showing the SLEAP version information and related details.

    You can also check whether SLEAP can use the GPU with

    python -c "import sleap; sleap.system_summary()"

    which should produce output like the following when the GPU is available.

    GPUs: 1/1 available
      Device: /physical_device:GPU:0
             Available: True
           Initialized: False
         Memory growth: None

    In future posts, I hope to walk through how to actually use SLEAP.

    Bonus

    For those unsure which computer to buy, I’ve started offering PC purchase consultations on Coconala!

    あなたの要望に合わせてパソコンを選び、提案します パソコン選びに困っている方々へ!様々な目的に対応できます!

    I often pick out computers and give advice on them, and many friends have told me I could make money doing PC consultations.
    That inspired me to give it a try!

    I’ll recommend a machine that fits both what you want to use it for and your budget.
    In particular, I’ve chosen and used many computers for machine learning.

    And if you’d like, I’m happy to advise you on what to look for the next time you buy a computer.

    Machines I’ve picked out so far include lab analysis computers, everyday-use computers, computers for game streaming, computers for incoming university students, computers that can run CAD for architecture students, and simple stopgap machines.

    I use both Mac and Windows, so I can talk about and recommend either one!

    Please feel free to make use of it.