[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-10693":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":33,"readmeContent":34,"aiSummary":35,"trendingCount":16,"starSnapshotCount":16,"syncStatus":36,"lastSyncTime":37,"discoverSource":38},10693,"TensorFlow.NET","SciSharp\u002FTensorFlow.NET","SciSharp",".NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.","https:\u002F\u002Fscisharp.github.io\u002Ftensorflow-net-docs",null,"C#",3394,539,126,221,0,1,6,61.3,"Apache License 2.0",false,"master",true,[25,26,27,28,29,30,31,32],"chatbot","csharp","deep-learning","dotnetcore","keras","machine-learning","scisharp","tensorflow","2026-06-12 04:00:51","![logo](docs\u002Fassets\u002Ftf.net.logo.png)\n\n**TensorFlow.NET** (TF.NET) provides a .NET Standard binding for [TensorFlow](https:\u002F\u002Fwww.tensorflow.org\u002F). It aims to implement the complete Tensorflow API in C# which allows .NET developers to develop, train and deploy Machine Learning models with the cross-platform .NET Standard framework. TensorFlow.NET has built-in Keras high-level interface and is released as an independent package [TensorFlow.Keras](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FTensorFlow.Keras\u002F).\n\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1106946823282761851?label=Discord)](https:\u002F\u002Fdiscord.gg\u002FqRVm82fKTS)\n[![QQ群聊](https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?label=QQ&message=群聊&color=brightgreen)](http:\u002F\u002Fqm.qq.com\u002Fcgi-bin\u002Fqm\u002Fqr?_wv=1027&k=sN9VVMwbWjs5L0ATpizKKxOcZdEPMrp8&authKey=RLDw41bLTrEyEgZZi%2FzT4pYk%2BwmEFgFcrhs8ZbkiVY7a4JFckzJefaYNW6Lk4yPX&noverify=0&group_code=985366726)\n[![Join the chat at https:\u002F\u002Fgitter.im\u002Fpubliclab\u002Fpubliclab](https:\u002F\u002Fbadges.gitter.im\u002FJoin%20Chat.svg)](https:\u002F\u002Fgitter.im\u002Fsci-sharp\u002Fcommunity)\n[![CI Status](https:\u002F\u002Fgithub.com\u002FSciSharp\u002FTensorFlow.NET\u002Factions\u002Fworkflows\u002Fbuild_and_test.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002FSciSharp\u002FTensorFlow.NET\u002Factions\u002Fworkflows\u002Fbuild_and_test.yml)\n[![Documentation Status](https:\u002F\u002Freadthedocs.org\u002Fprojects\u002Ftensorflownet\u002Fbadge\u002F?version=latest)](https:\u002F\u002Ftensorflownet.readthedocs.io\u002Fen\u002Flatest\u002F?badge=latest)\n[![TensorFlow.NET Badge](https:\u002F\u002Fimg.shields.io\u002Fnuget\u002Fv\u002FTensorFlow.NET?label=TensorFlow.NET)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FTensorFlow.NET)\n[![TensorFlow.Keras Badge](https:\u002F\u002Fimg.shields.io\u002Fnuget\u002Fv\u002FTensorFlow.Keras?label=TensorFlow.Keras)](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FTensorFlow.Keras)\n[![MyGet Badge](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdynamic\u002Fjson?color=purple&label=Nightly%20Release&prefix=myget-v&query=items%5B0%5D.lower&url=https%3A%2F%2Fwww.myget.org%2FF%2Fscisharp%2Fapi%2Fv3%2Fregistration1%2Ftensorflow.net%2Findex.json)](https:\u002F\u002Fwww.myget.org\u002Ffeed\u002Fscisharp\u002Fpackage\u002Fnuget\u002FTensorflow.NET)\n[![Badge](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flink-996.icu-red.svg)](https:\u002F\u002F996.icu\u002F#\u002Fen_US)\n[![Binder](https:\u002F\u002Fmybinder.org\u002Fbadge_logo.svg)](https:\u002F\u002Fmybinder.org\u002Fv2\u002Fgh\u002Fjaviercp\u002FBinderTF.NET\u002Fmaster?urlpath=lab)\n\nEnglish | [中文](docs\u002FREADME-CN.md)\n\n> [!IMPORTANT]\n> We're happy that our work on tensorflow.net has attracted many users. However, at this time, none of the main maintainers of this repo is available for new features and bug fix. We won't refuse PRs and will help to review them.\n> \n> If you would like to be a contributor or maintainer of tensorflow.net, we'd like to help you to start up.\n>\n> We feel sorry for that and we'll resume the maintaining for this project once one of us has bandwidth for it.\n>   \n\n*master branch and v0.100.x is corresponding to tensorflow v2.10, v0.6x branch is from tensorflow v2.6, v0.15-tensorflow1.15 is from tensorflow1.15. Please add `https:\u002F\u002Fwww.myget.org\u002FF\u002Fscisharp\u002Fapi\u002Fv3\u002Findex.json` to nuget source to use nightly release.*\n\n\n![tensors_flowing](docs\u002Fassets\u002Ftensors_flowing.gif)\n\n## Why Tensorflow.NET ?\n\n`SciSharp STACK`'s mission is to bring popular data science technology into the .NET world and to provide .NET developers with a powerful Machine Learning tool set without reinventing the wheel. Since the APIs are kept as similar as possible you can immediately adapt any existing TensorFlow code in C# or F# with a zero learning curve. Take a look at a comparison picture and see how comfortably a TensorFlow\u002FPython script translates into a C# program with TensorFlow.NET.\n\n![python vs csharp](docs\u002Fassets\u002Fsyntax-comparision.png)\n\nSciSharp's philosophy allows a large number of machine learning code written in Python to be quickly migrated to .NET, enabling .NET developers to use cutting edge machine learning models and access a vast number of TensorFlow resources which would not be possible without this project.\n\nIn comparison to other projects, like for instance [TensorFlowSharp](https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FTensorFlowSharp\u002F) which only provide TensorFlow's low-level C++ API and can only run models that were built using Python, Tensorflow.NET makes it possible to build the pipeline of training and inference with pure C# and F#. Besides, Tensorflow.NET provides binding of Tensorflow.Keras to make it easy to transfer your code from python to .NET.\n\n[ML.NET](https:\u002F\u002Fgithub.com\u002Fdotnet\u002Fmachinelearning) also take Tensorflow.NET as one of the backends to train and infer your model, which provides better integration with .NET.\n\n## Documention\n\nIntroduction and simple examples：[Tensorflow.NET Documents](https:\u002F\u002Fscisharp.github.io\u002Ftensorflow-net-docs)\n\nDetailed documention：[The Definitive Guide to Tensorflow.NET](https:\u002F\u002Ftensorflownet.readthedocs.io\u002Fen\u002Flatest\u002FFrontCover.html)\n\nExamples：[TensorFlow.NET Examples](https:\u002F\u002Fgithub.com\u002FSciSharp\u002FTensorFlow.NET-Examples)\n\nTroubleshooting of running example or installation：[Tensorflow.NET FAQ](tensorflowlib\u002FREADME.md)\n\n## Usage\n\n### Installation\n\nYou can search the package name in NuGet Manager, or use the commands below in package manager console.\n\nThe installation contains two parts, the first is the main body:\n\n```sh\n### Install Tensorflow.NET\nPM> Install-Package TensorFlow.NET\n\n### Install Tensorflow.Keras\nPM> Install-Package TensorFlow.Keras\n```\n\nThe second part is the computing support part. Only one of the following packages is needed, depending on your device and system.\n\n```\n### CPU version for Windows and Linux\nPM> Install-Package SciSharp.TensorFlow.Redist\n\n### CPU version for MacOS\nPM> Install-Package SciSharp.TensorFlow.Redist-OSX\n\n### GPU version for Windows (CUDA and cuDNN are required)\nPM> Install-Package SciSharp.TensorFlow.Redist-Windows-GPU\n\n### GPU version for Linux (CUDA and cuDNN are required)\nPM> Install-Package SciSharp.TensorFlow.Redist-Linux-GPU\n```\n\n\nTwo simple examples are given here to introduce the basic usage of Tensorflow.NET. As you can see, it's easy to write C# code just like that in Python.\n\n### Example - Linear Regression in `Eager` mode\n\n```csharp\nusing static Tensorflow.Binding;\nusing static Tensorflow.KerasApi;\nusing Tensorflow;\nusing Tensorflow.NumPy;\n\n\u002F\u002F Parameters        \nvar training_steps = 1000;\nvar learning_rate = 0.01f;\nvar display_step = 100;\n\n\u002F\u002F Sample data\nvar X = np.array(3.3f, 4.4f, 5.5f, 6.71f, 6.93f, 4.168f, 9.779f, 6.182f, 7.59f, 2.167f,\n             7.042f, 10.791f, 5.313f, 7.997f, 5.654f, 9.27f, 3.1f);\nvar Y = np.array(1.7f, 2.76f, 2.09f, 3.19f, 1.694f, 1.573f, 3.366f, 2.596f, 2.53f, 1.221f,\n             2.827f, 3.465f, 1.65f, 2.904f, 2.42f, 2.94f, 1.3f);\nvar n_samples = X.shape[0];\n\n\u002F\u002F We can set a fixed init value in order to demo\nvar W = tf.Variable(-0.06f, name: \"weight\");\nvar b = tf.Variable(-0.73f, name: \"bias\");\nvar optimizer = keras.optimizers.SGD(learning_rate);\n\n\u002F\u002F Run training for the given number of steps.\nforeach (var step in range(1, training_steps + 1))\n{\n    \u002F\u002F Run the optimization to update W and b values.\n    \u002F\u002F Wrap computation inside a GradientTape for automatic differentiation.\n    using var g = tf.GradientTape();\n    \u002F\u002F Linear regression (Wx + b).\n    var pred = W * X + b;\n    \u002F\u002F Mean square error.\n    var loss = tf.reduce_sum(tf.pow(pred - Y, 2)) \u002F (2 * n_samples);\n    \u002F\u002F should stop recording\n    \u002F\u002F Compute gradients.\n    var gradients = g.gradient(loss, (W, b));\n\n    \u002F\u002F Update W and b following gradients.\n    optimizer.apply_gradients(zip(gradients, (W, b)));\n\n    if (step % display_step == 0)\n    {\n        pred = W * X + b;\n        loss = tf.reduce_sum(tf.pow(pred - Y, 2)) \u002F (2 * n_samples);\n        print($\"step: {step}, loss: {loss.numpy()}, W: {W.numpy()}, b: {b.numpy()}\");\n    }\n}\n```\n\nRun this example in [Jupyter Notebook](https:\u002F\u002Fgithub.com\u002FSciSharp\u002FSciSharpCube).\n\n### Example - Toy version of `ResNet` in `Keras` functional API\n\n```csharp\nusing static Tensorflow.Binding;\nusing static Tensorflow.KerasApi;\nusing Tensorflow;\nusing Tensorflow.NumPy;\n\nvar layers = keras.layers;\n\u002F\u002F input layer\nvar inputs = keras.Input(shape: (32, 32, 3), name: \"img\");\n\u002F\u002F convolutional layer\nvar x = layers.Conv2D(32, 3, activation: \"relu\").Apply(inputs);\nx = layers.Conv2D(64, 3, activation: \"relu\").Apply(x);\nvar block_1_output = layers.MaxPooling2D(3).Apply(x);\nx = layers.Conv2D(64, 3, activation: \"relu\", padding: \"same\").Apply(block_1_output);\nx = layers.Conv2D(64, 3, activation: \"relu\", padding: \"same\").Apply(x);\nvar block_2_output = layers.Add().Apply(new Tensors(x, block_1_output));\nx = layers.Conv2D(64, 3, activation: \"relu\", padding: \"same\").Apply(block_2_output);\nx = layers.Conv2D(64, 3, activation: \"relu\", padding: \"same\").Apply(x);\nvar block_3_output = layers.Add().Apply(new Tensors(x, block_2_output));\nx = layers.Conv2D(64, 3, activation: \"relu\").Apply(block_3_output);\nx = layers.GlobalAveragePooling2D().Apply(x);\nx = layers.Dense(256, activation: \"relu\").Apply(x);\nx = layers.Dropout(0.5f).Apply(x);\n\u002F\u002F output layer\nvar outputs = layers.Dense(10).Apply(x);\n\u002F\u002F build keras model\nvar model = keras.Model(inputs, outputs, name: \"toy_resnet\");\nmodel.summary();\n\u002F\u002F compile keras model in tensorflow static graph\nmodel.compile(optimizer: keras.optimizers.RMSprop(1e-3f),\n    loss: keras.losses.SparseCategoricalCrossentropy(from_logits: true),\n    metrics: new[] { \"acc\" });\n\u002F\u002F prepare dataset\nvar ((x_train, y_train), (x_test, y_test)) = keras.datasets.cifar10.load_data();\n\u002F\u002F normalize the input\nx_train = x_train \u002F 255.0f;\n\u002F\u002F training\nmodel.fit(x_train[new Slice(0, 2000)], y_train[new Slice(0, 2000)],\n            batch_size: 64,\n            epochs: 10,\n            validation_split: 0.2f);\n\u002F\u002F save the model\nmodel.save(\".\u002Ftoy_resnet_model\");\n```\n\nThe F# example for linear regression is available [here](docs\u002FExample-fsharp.md).\n\nMore adcanced examples could be found in [TensorFlow.NET Examples](https:\u002F\u002Fgithub.com\u002FSciSharp\u002FTensorFlow.NET-Examples).\n\n## Version Relationships\n\n| TensorFlow.NET Versions                 | tensorflow 1.14, cuda 10.0 | tensorflow 1.15, cuda 10.0 | tensorflow 2.3, cuda 10.1 | tensorflow 2.4, cuda 11 | tensorflow 2.7, cuda 11 |tensorflow 2.10, cuda 11 |\n| -------------------------- | ------------- | -------------- | ------------- | ------------- | ------------ | ------------ |\n| tf.net 0.10x, tf.keras 0.10 |  |  |  |  |  | x |\n| tf.net 0.7x, tf.keras 0.7   |  |  |  |  | x |  |\n| tf.net 0.4x, tf.keras 0.5   |  |  |  | x |  |  |\n| tf.net 0.3x, tf.keras 0.4   |  |  | x |  |  |  |\n| tf.net 0.2x                 |  | x | x |  |  |  |\n| tf.net 0.15                 | x | x |  |  |  |  |\n| tf.net 0.14                 | x |  |  |  |  |  |\n\n\n```\ntf.net 0.4x -> tf native 2.4 \ntf.net 0.6x -> tf native 2.6      \ntf.net 0.7x -> tf native 2.7\ntf.net 0.10x -> tf native 2.10\n...\n```\n\n## Contribution:\n\nFeel like contributing to one of the hottest projects in the Machine Learning field? Want to know how Tensorflow magically creates the computational graph? \n\nWe appreciate every contribution however small! There are tasks for novices to experts alike, if everyone tackles only a small task the sum of contributions will be huge.\n\nYou can:\n- Star Tensorflow.NET or share it with others\n- Tell us about the missing APIs compared to Tensorflow\n- Port Tensorflow unit tests from Python to C# or F#\n- Port Tensorflow examples to C# or F# and raise issues if you come accross missing parts of the API or BUG\n- Debug one of the unit tests that is marked as Ignored to get it to work\n- Debug one of the not yet working examples and get it to work\n- Help us to complete the documentions.\n\n\n#### How to debug unit tests:\n\nThe best way to find out why a unit test is failing is to single step it in C# or F# and its corresponding Python at the same time to see where the flow of execution digresses or where variables exhibit different values. Good Python IDEs like PyCharm let you single step into the tensorflow library code. \n\n#### Git Knowhow for Contributors\n\nAdd SciSharp\u002FTensorFlow.NET as upstream to your local repo ...\n```git\ngit remote add upstream git@github.com:SciSharp\u002FTensorFlow.NET.git\n```\n\nPlease make sure you keep your fork up to date by regularly pulling from upstream. \n```git\ngit pull upstream master\n```\n\n### Support\nBuy our book to make open source project be sustainable [TensorFlow.NET实战](https:\u002F\u002Fitem.jd.com\u002F13441549.html)\n\u003Cp float=\"left\">\n\u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F1705364\u002F198852429-91741881-c196-401e-8e9e-2f8656196613.png\" width=\"250\" \u002F>\n\u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F1705364\u002F198852521-2f842043-3ace-49d2-8533-039c6a043a3f.png\" width=\"260\" \u002F>\n\u003Cimg src=\"https:\u002F\u002Fuser-images.githubusercontent.com\u002F1705364\u002F198852721-54cd9e7e-9210-4931-a86c-77584b25b8e1.png\" width=\"260\" \u002F>\n\u003C\u002Fp>\n\n### Contact\n\nJoin our chat on [Discord](https:\u002F\u002Fdiscord.gg\u002FqRVm82fKTS) or [Gitter](https:\u002F\u002Fgitter.im\u002Fsci-sharp\u002Fcommunity).\n\nFollow us on [Twitter](https:\u002F\u002Ftwitter.com\u002FScisharpStack), [Facebook](https:\u002F\u002Fwww.facebook.com\u002Fscisharp.stack.9), [Medium](https:\u002F\u002Fmedium.com\u002Fscisharp), [LinkedIn](https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Fscisharp-stack\u002F).\n\nTensorFlow.NET is a part of [SciSharp STACK](https:\u002F\u002Fscisharp.github.io\u002FSciSharp\u002F)\n\u003Cbr>\n\u003Ca href=\"http:\u002F\u002Fscisharpstack.org\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FSciSharp\u002FSciSharp\u002Fblob\u002Fmaster\u002Fart\u002Fscisharp-stack.png\" width=\"391\" height=\"100\" \u002F>\u003C\u002Fa>\n","TensorFlow.NET 是一个为 .NET Standard 平台提供的 TensorFlow 绑定库，支持 C# 和 F# 开发者在 .NET 生态中开发、训练和部署机器学习模型。该项目实现了完整的 TensorFlow API，并集成了 Keras 高级接口，使得构建复杂的深度学习模型变得更加简单。此外，它还支持跨平台操作，便于在不同环境中进行模型的移植与应用。TensorFlow.NET 适用于需要在 .NET 环境下利用 TensorFlow 功能的各种场景，包括但不限于聊天机器人开发、图像识别任务以及自然语言处理等。",2,"2026-06-11 03:29:45","top_topic"]