How to Install and use Starnet 2 for PixInsight - Tutorial
Updated: Jun 7, 2023
How to install and use StarNet2 on PixInsight? In this post, I will go over how to get StarNet2 to work on PixInsight and give you a few tips on how to use it. It is fairly easy to install but I did run into three issues myself which I will share below.
You can watch our video tutorial HERE.
[Update 2023]
We now recommend installing StarXTerminator instead, which is updated more often usually works better.
On January 24th, 2022, Nikita Misiura (the maker of StarNet) announced that Version 2 of StarNet was available!
Since its release in February 2019, StarNet has been a very important tool when processing astrophotography images. Being able to remove stars from a picture allows you to bring out much more of the nebulosity or overall signal from an image.
The problem with the first version of Starnet is that it sometimes left a lot of artifacts, especially around bright stars. Although rare, the artifacts left from the process would sometimes be too overwhelming to even be worth it. Also, Starnet V1 was a little difficult to install. You might have found our tutorial useful back then!
Luckily, installing StarNet 2 is easier this time around. If you have error messages or other issues during your installation, be sure to scroll to the bottom of this page and you might find an answer!
Step 1 - Install the latest version of PixInsight
The first thing you need to do is update PixInsight to the latest version (1.8.8-12 at the time of writing this tutorial).
If you're a Mac user, first uninstall the application by dragging it from the Applications folder to the trash (make sure you do not trash the files in your "Library" folder though as those contain your license and user preferences). To access that library folder, open a new finder window, click on the "Go" tab at the top, hold "Option" for the library to appear, and select it). Once again, don't touch any of these files.
Next, head over to the PixInsight Software Distribution page and download the latest version on your computer.
In our case, we downloaded the second option as we are using a Mac computer.
[Optional] After installing the package, launch PixInsight and see if any update window pops up as you may have to install a small update internally as well. Once this is done, close the program.
Step 2 - Download Version 2 of StarNet
You now need to download the 2nd version of StarNet. To do this, simply CLICK HERE and download the version that works for your computer (Windows or Mac).
You do not need to uninstall or delete any of the previous StarNet files. StarNet 2 will work just fine even if StarNet 1 is also installed.
Unzip the downloaded file anywhere on your computer, and open the folder to see its contents.
Step 3 - Transfer the Files to the Correct PixInsight Folders
Open a new window on your computer and locate your PixInsight folder. On Windows, I assume it should be in your Program Files folder, but if you're on Mac, you need to go to:
Applications > PixInsight > Library
You now need to copy/paste or drag a few files from the StarNet folder you just downloaded into a couple of PixInsight folders.
Place the "StarNet2_weights.pb" file into the "lib" folder [MAC] or "bin" folder [WINDOWS]
Place the "libtensortflow_framework.2.dylib", "libtensortflow.2.dylib" and "StarNet2-pxm.dylib" files into the "bin" folder.
We're not sure if this matters, but we also placed the "LICENSE" file into the "bin" folder as well.
In the end, the StarNet folder you grabbed the files from should only have the "README.txt" file and the empty "lib" folder remaining (unless you copied the other files instead of dragging them).
Want to learn all aspects of astrophotography in the most efficient way possible?
The Galactic Course includes a LIFETIME membership that gives you unlimited access to all current and upcoming astrophotography content. Step into an ever-growing realm of knowledge and learn at your own pace. Make life-long friends and connections with other members, and get tips from instructors that truly care about your journey and progress under the night sky.
Step 4 - Launch PixInsight and Import StarNet 2
Now, launch PixInsight. You likely will have a pop-up window that will tell you to update one or several internal files (which should include StarNet 2). You can see what this window looks like below. Accept the update and relaunch PixInsight.
If you did NOT have this pop-up window, do the following:
Go to Process > Modules > Install Modules
Click on Search
The StarNet 2 file should appear in the list. Click on it, then click on "Install".
Step 5 - Use StarNet 2 on your Images!
The StarNet process is extremely easy to use. This second version has four different options you can play with:
Stride
You can pick either 128 or 256. Nikita recommends keeping this on the default number which is 256.
Create starmask
This will make a star mask from your image. We always activate that because we then use the mask near the end of our processing workflow to add the stars to our image again.
2x upsample
This is new. According to Nikita, StarNet works better on upsampled images. If your file is already drizzled/upsampled, then you should leave that unchecked. If your file is not upsampled, then maybe try to check it before applying the process. It will temporarily upscale your image before removing the stars, then sample it back to its original size.
Linear data
This is also new. You can now easily apply StarNet in the linear phase, which is great! Checking this option will temporarily stretch your image while the stars are being removed.
How well does this second version work?
We tried the first version of StarNet and the second version on the same exact image, which you can see below. The difference is incredible! StarNet Version 1 was used on the left. StarNet Version 2 was used on the right. Notice how many more stars are removed in the second version, and how much cleaner the overall image is. Of course, there are still some artifacts here and there where bright stars were, but those are simple to remove using the CloneStamp tool for example.
Oh and definitely check out our full blog post about our Rosette Nebula image where you can see it in high resolution along with a ton of tips :)
HELP! I'm Having Issues!
Are you running into error messages when trying to install StarNet 2? Well, I also did. Three to be precise. Below are the issues I encountered and how I was able to get past them:
Error 1 - Crazy long and confusing error message when opening PixInsight and/or trying to search for the module in the Module Installer
So.. you might get an error that goes a little like:
/Applications/Pixinsight/bin/StarNet-pxm.dylib Cannot load library Applications/PixInsight/bin/StarNet-pxm.dylib:(dlopen(/Applications/Pixinsight/bin/StarNet pxm.dylib, Ox0006): Library not loaded:@loader_path/libtensorflow.2.dylib Referenced from:/Applications/PixInsight/bin/StarNet-pxm.dylib
Reason: tried: '/Applications/PixInsight/bin/libtensorflow.2.dylib' (code signature in<CDAA317D-918D-3592-ABB7-B13D174D1614> Y
Applications/PixInsight/bin/libtensorflow.2.dylib'not valid for use in process: library load disallowed by system policy), '/usr/lib/libtensorflow.2.dylib' (no such file)): Module load error
Yes, very messy and scary... But easy to fix!
This seems to occur because the files are not trusted by your computer (which happens often with files downloaded from websites like SourceForge which are sometimes deemed unsafe). To remedy this, find all 3 files affected in the PixInsight > "bin" folder. Right-click on each and select "Open". Then accept the security message. This will mark the files as safe. Now relaunch PixInsight and try again!
Error 2 - <* Module identification error *>
This may occur when selecting the StarNet file in the Install Modules window. It is confusing especially if you believe you did every step right. Well, you didn't. Go back to Step 1. That's right!
This seems to happen because you have a version of PixInsight that is a bit too old to load StarNet 2. Be sure to go on the PixInsight website, and download the latest version. CLICK HERE to get to that page!
Once that is done, be sure to re-copy the StarNet 2 files into their respective PixInsight folder. In short, re-do all the steps above.
Error 3 - *** Error: Could not find checkpoint file '/Applications/PixInsight/lib/StarNet2 weights.pb'!
This may occur shortly after you launched a StarNet 2 instance on an image. The software is trying to load the weights but cannot find them.
*** Error: Could not find checkpoint file '/Applications/PixInsight/lib/StarNet2 weights.pb'!
What you most likely did wrong is:
Place the "StarNet2_weights.pb" file into the "lib" folder.
Be sure to have that file (which ends in .pb) inside the "lib" folder of the PixInsight folder. If you still get the same error message, then paste that file into the "bin" folder as well. Once you did that, try again.
Error 4 - It still doesn't work!! I am on an M1 Mac
If you are on an M1 Mac, try following the advice from this post: https://www.cloudynights.com/topic/808556-starnet-v2/?p=11671654
Final Thoughts
StarNet is a great tool for astrophotography that can be used to remove stars in your images. This second version is a great improvement over the first one, and we are very thankful that it is made available for free to everyone, thanks Nikita! We hope this short guide helped you install and use StarNet 2 on your computer!
Make sure to follow us on Facebook, Instagram, Twitter and YouTube to stay up to date with our work!
Clear Skies,
Galactic Hunter
GALACTIC HUNTER BOOKS