I have a doubt regarding the Batchstream class used in sample of SampleSSD Application in TensorRT samples folder.
I saw Batchstream class reading label files also as seen in the below snippet:
std::string inputFileName = locateFile(mPrefix + std::to_string(mFileCount++) + mSuffix, mDataDir);
FILE* file = fopen(inputFileName.c_str(), "rb");
size_t readSize = fread(d, sizeof(int), 4, file);
ASSERT(readSize == 4);
ASSERT(mDims.d == d && mDims.d == d && mDims.d == d && mDims.d == d);
size_t readInputCount = fread(getFileBatch(), sizeof(float), mDims.d * mImageSize, file);
ASSERT(readInputCount == size_t(mDims.d * mImageSize));
size_t readLabelCount = fread(getFileLabels(), sizeof(float), mDims.d, file);
ASSERT(readLabelCount == 0 || readLabelCount == size_t(mDims.d));
I want to understand, if we need labels also for implementing calibrator(PTQ) in the C++ Application of TensorRT.
Thanks and Regards,
Labels are not required for the Calibration.
Please refer to Developer Guide :: NVIDIA Deep Learning TensorRT Documentation for more details.
Thanks for your reply!
I too read the same in the documentation, but when i was looking into the implementation of class BatchStream in sampleSSD application, i found it is reading Lables also. you can check the snippet shared above.
Can you please help me to understand why the above snippet has label reading code.
Class BatchStream is only used by the calibrators and therefore doesn’t need to use the labels. I think the above one is a mistake. Hope you’re referring to the correct sample code.
This file has been truncated.
* SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
//! This file contains the implementation of the SSD sample. It creates the network using