Benny Istanto Logo Benny Istanto Logo
  • Home
  • About
  • CSR
  • Blog
    • All Posts
    • Archive by Year
  • Works
    • Overview
    • Experiences
    • Projects
    • Consulting
    • Maps & Infographics
  • CV

TensorFlow will not install, and it is not your fault

Data Science
Research
Five ways the install fails, one per platform, and the two escape routes that mean you may not need it at all.
Author

Benny Istanto

Published

February 13, 2025

Bias CorrectionPart 12 of 30
What you see What it means What fixes it
ImportError: DLL load failed while importing _pywrap_tensorflow_internal Windows is missing the Visual C++ runtime Install the Visual C++ Redistributable
cannot enable executable stack as shared object requires WSL or Linux without execstack permission pip install patchelf, then clear the exec stack on libtensorflow_cc.so.2
Runs, but on CPU, with a GPU sitting right there CUDA or cuDNN does not match the TensorFlow build Let conda pin it: mamba install tensorflow
ResourceExhaustedError: OOM when allocating tensor Another CUDA process is holding memory Restart the kernel; set TF_FORCE_GPU_ALLOW_GROWTH=true before importing
No error at all. It just hangs. keras and tf-keras are fighting Uninstall both, reinstall from conda-forge

That is the useful part of this post. The rest is commentary.

I have now lost more hours to installing TensorFlow than to writing the model that uses it, and that ratio is embarrassing enough to write down, partly so the next person does not repeat it and partly so I stop.

The symptom is always the same shape. The statistical correction runs perfectly. Then the notebook reaches the neural step and dies.

The one that cost the most

The last row. A silent hang gives you nothing to search for, and my first instinct was that my own training loop had deadlocked. It had not. Two packages that both want to be keras were installed side by side, and neither complained about the other.

There is a sixth, specific to Windows under Git Bash: the conda environment’s DLLs have to be on PATH before Python starts. Not inside the script. Not in the notebook. Before.

The part I had backwards

For a long time I treated a working local install as the goal, and the model as what came after. Wrong order.

Three questions, and only one of them ends in a CUDA version

Three questions, and only one of them ends in a CUDA version

Two questions get most people out before they ever reach that table.

Do you need the neural stage at all? If not, there is a config flag for exactly this. Set the blend weight to 1.0 and the pipeline trains no network, imports no TensorFlow, and writes the neural output as an exact copy of the statistical one. Linear scaling and quantile mapping run untouched, and they are doing the overwhelming majority of the work anyway.

That is not a fix. It is an admission that the expensive dependency is optional, which is worth knowing before you spend an afternoon on it.

Is your data too sensitive to upload? If not, use Colab. TensorFlow is already there, the GPU is provisioned, and the entire table above stops existing. The Bali example runs end to end in about 72 minutes on the free CPU tier, the longest single notebook taking around 45 of them.

I resisted this for a while, and the resistance was mostly pride. Running on someone else’s machine felt like not having really solved the problem. But the problem I was trying to solve was bias correction, not CUDA version alignment, and the hours are the same hours either way.

Colab has its own friction

Not none. Different.

The free tier disconnects on idle, which is fatal partway through a long run. Run top to bottom in one sitting, mount Drive at the start and write outputs there, and if you only want a sanity check, run a few dekads rather than all thirty-six.

Memory is the other one. The visualisation notebook generates something like seventeen hundred figures in a batch, and matplotlib will hold on to every one. The framework closes figures and collects garbage at the end of each period; any loop you write yourself needs the same discipline. And if you trained the model earlier in the same session, TensorFlow still has it in RAM. Restart the kernel between the two.

The general version

A heavy optional dependency should be optional in practice, not just in principle.

That config flag exists because I got stuck once and wanted a way to keep working. It turned out to be the most useful thing I built that week. If a stage of your pipeline can be switched off with one value, and the rest still produces a valid result, then a broken install is an inconvenience instead of a wall.

Worth designing for before you need it.

Back to top
PreviousTwo convolutions and fifty million parameters NextThe model that refuses to help

© 2026, Benny Istanto.

Exploring Climate with GIS and Data Science, solving old problems in new ways. Turning earth observation data into actionable, life-saving insights.

Built with Quarto

  • View source
  • Report an issue

Buy Me a Coffee