julrog / nn_vis

A project for processing neural networks and rendering to gain insights on the architecture and parameters of a model through a decluttered representation.
MIT License
1.09k stars 186 forks source link

Why does my visualisation window appear blank? #46

Closed yuanchaoX closed 1 year ago

yuanchaoX commented 1 year ago

As the title suggests, after running the start_tool.py--demo file, the model structure is not visualised

julrog commented 1 year ago

I tested the scripts again and found some bugs and fixed them in the latest commit. One of them could fix your problem. The sample files could not be downloaded properly, but now it should work. I also added another sample network and both networks not fully processed (with just the importance values). When running start_tool.py --demo it should download these into storage/data folder. It should also load one network per default with the --demo flag. Otherwise I added info on how to load the other models in the README (see section "How to use"). Let me know if this fixes the problem. If not, please let me know what the tool.log says (please modify/remove the paths, if they could contain sensitive information).

yuanchaoX commented 1 year ago

Thank you very much for your help, but my problem was not solved。 tool.log:2023-10-12 10:57:14,628 - INFO - Using sample model at "E:\cc\nn_vis-master/storage/data/sample_model.pro.npz" 2023-10-12 10:57:14,629 - INFO - Loading sample model... 2023-10-12 10:57:15,134 - INFO - OpenGL Version: 4.6 2023-10-12 10:57:15,134 - INFO - Prepare network processing for network of size: [784, 81, 49, 10] 2023-10-12 10:57:15,134 - INFO - Create network model... 2023-10-12 10:57:15,139 - INFO - Create grid... 2023-10-12 10:57:15,139 - INFO - Prepare node processing... 2023-10-12 10:57:15,144 - INFO - Prepare edge processing... 2023-10-12 10:57:20,664 - INFO - Prepare grid processing... 2023-10-12 10:57:20,784 - INFO - Calculate grid positions. 2023-10-12 10:57:20,801 - INFO - Resample 6783 edges

julrog commented 1 year ago

OpenGL Version seems fine, the file exists. Depending on your hardware it might take a while to load everything. But 6783 edges suggest its already pruning 90% of edges (configured in config/processing.json so i would assume it shouldn't take that long.

Do you get any errors in console? And when running start_tool.py without --demo does it work fine? What GPU are you using?

Nigroi commented 1 year ago

How to load and visualize the model I trained myself?

julrog commented 1 year ago

@Nigroi currently it only supports Feedforward neural networks (FNN) and needs a portion of the training data (or any labelled dataset usable by your model) and you have to code a bit for using your own models and need it to be compatible with tensorflow.

examples/process_mnist_model.py should be a good starting point for that. This script basically goes through the whole process of training, generating importance data, processing (node and edge bundling) and finally rendering some pictures of the processed network on a FNN model trained on MNIST dataset. Unfortunately you have to go into the code I wrote as a student quite a while ago, so it might not be so easy to understand.

julrog commented 1 year ago

No answer, closing.