Skip to content

Instantly share code, notes, and snippets.

View JustinhoCHN's full-sized avatar

IronJustin JustinhoCHN

View GitHub Profile
@JustinhoCHN
JustinhoCHN / Makefile
Last active June 29, 2021 06:34
nvdsanalytics + msgconv
################################################################################
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@JustinhoCHN
JustinhoCHN / fit_generator_issue.md
Last active November 3, 2020 15:05
" slice index 1 of dimension 0 out of bounds" when implementing multi-output fit_generator

Hi guys, I have a issue about implementing fit_generator with multi-input-output, here's my problem:

my model is 3 inputs and 3 outputs, I have to build a generator myself like:

def multi_input_generator(data_path):
    gen = image.ImageDataGenerator()
    trn_a = gen.flow_from_directory(data_path + 'a/', target_size=(224, 224), batch_size=1, class_mode=None, shuffle=False)
    trn_p = gen.flow_from_directory(data_path + 'p/', target_size=(224, 224), batch_size=1, class_mode=None, shuffle=False)
    trn_n = gen.flow_from_directory(data_path + 'n/', target_size=(224, 224), batch_size=1, class_mode=None, shuffle=False)