Optimize an NCF Inference Model with TensorFlow*

Published: 10/23/2020  

Last Updated: 06/15/2022

Download Command

wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/ncf-fp32-inference.tar.gz


Download the MovieLens 1M dataset

wget http://files.grouplens.org/datasets/movielens/ml-1m.zip
unzip ml-1m.zip

Set the DATASET_DIR to point to this directory when running NCF.

Quick Start Scripts

Script name Description
fp32_online_inference Runs online inference (batch_size=1).
fp32_batch_inference Runs batch inference (batch_size=256).
fp32_accuracy Measures the model accuracy (batch_size=256).

Bare Metal

To run on bare metal, the following prerequisites must be installed in your environment:

  • Python* 3
  • Intel® Optimization for TensorFlow*
  • Numactl
  • Google* API Python* client 1.6.7
  • Google Cloud* enterprise services BigQuery* 0.31.0
  • Kaggle* 1.3.9
  • NumPy 1.16.1
  • Oauth2client 4.1.2
  • pandas psutil 5.4.3
  • Py-cpuinfo 3.3.0
  • Typing
  • TensorFlow* models: Clone the official repository with the tag v1.11.
git clone https://github.com/tensorflow/models.git tf_models
cd tf_models
git checkout v1.11

After installing the prerequisites, download and untar the model package. Set environment variables for the path to your DATASET_DIR and an OUTPUT_DIR where log files will be written, then run a quick start script.

DATASET_DIR=<path to the dataset>
OUTPUT_DIR=<directory where log files will be written>
TF_MODELS_DIR=<path to the TensorFlow models directory tf_models>

wget https://storage.googleapis.com/intel-optimized-tensorflow/models/v2_3_0/ncf-fp32-inference.tar.gz
tar -xzf ncf-fp32-inference.tar.gz
cd ncf-fp32-inference

quickstart/<script name>.sh

Documentation and Sources

Get Started​
Main GitHub*
Release Notes
Get Started Guide

Code Sources
Report Issue

License Agreement

LEGAL NOTICE: By accessing, downloading or using this software and any required dependent software (the “Software Package”), you agree to the terms and conditions of the software license agreements for the Software Package, which may also include notices, disclaimers, or license terms for third party software included with the Software Package. Please refer to the license file for additional details.

Related Containers and Solutions

NCF FP32 Inference TensorFlow* Container

View All Containers and Solutions 🡢

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.