Running the sample
This sample requires TensorFlow 1.14 due to a bug in
BatchNormalization layer in 1.10.
- Create new Conda environment named
conda create -n tf-1.x python=3.7(
brew cask install minicondato get
- Activate that environment:
conda activate tf-1.14
- Install TensorFlow 1.14:
python -m pip install "tensorflow==1.14.*"
- Navigate to this directory
- Set environment variable
set ... = ...on Windows,
export ... = ...on Linux and Mac)
dotnet run --framework netcoreapp3.0 -- ui
Using the sample
- Download & extract pretrained model from GitHub or train your own (instructions pending)
- Launch CSharpOrNot (see above). A dialog will appear to load model weights.
- Find weights
.hdf5file to load the model
- Click on "Open File..." to load code
- Select any source code file from your projects
- After it is loaded, move cursor around and watch programming language detected
- Click on "Open File..." again to load a different code file (no need to load model again)