-
-
Save OlafenwaMoses/6c948aa66ff19aeaa9fa6d4f5f462981 to your computer and use it in GitHub Desktop.
from imageai.Detection.Custom import DetectionModelTrainer | |
trainer = DetectionModelTrainer() | |
trainer.setModelTypeAsYOLOv3() | |
trainer.setDataDirectory(data_directory="hololens") | |
trainer.setTrainConfig(object_names_array=["hololens"], batch_size=4, num_experiments=100, train_from_pretrained_model="pretrained-yolov3.h5") | |
trainer.trainModel() |
34 self.net_w = 416
35
---> 36 if shuffle: np.random.shuffle(self.instances)
37
38 def len(self):
mtrand.pyx in numpy.random.mtrand.RandomState.shuffle()
TypeError: object of type 'NoneType' has no len()
please help me on this
I am having an issue where it is not seeing, or evaluating my validation samples.
As per the walk through provided at https://medium.com/deepquestai/train-object-detection-ai-with-6-lines-of-code-6d087063f6ff
I have split my images and annotations roughly 75% 25% between train and validation folders.
there are 69 files in each of the respective images and annotations folder within the validation folder.
when I run the 6lines I am returned
Generating anchor boxes for training images and annotation...
Average IOU for 9 anchors: 0.91
Anchor Boxes generated.
Detection configuration saved in Samples_forTraining\json\detection_config.json
Evaluating over 0 samples taken from Samples_forTraining\validation
Training over 203 samples given at Samples_forTraining\train
Training on: ['SnowMeter']
Training with Batch Size: 4
Number of Training Samples: 203
Number of Validation Samples: 0
Number of Experiments: 100
Training with transfer learning from pretrained Model
it giving an error
Using TensorFlow backend.
TypeError Traceback (most recent call last)
in ()
1
----> 2 from imageai.Detection.Custom import DetectionModelTrainer
3
4 trainer = DetectionModelTrainer()
5 trainer.setModelTypeAsYOLOv3()
21 frames
/usr/local/lib/python3.6/dist-packages/google/protobuf/descriptor.py in new(cls, name, package, options, serialized_options, serialized_pb, dependencies, public_dependencies, syntax, pool)
877 # TODO(amauryfa): use the pool passed as argument. This will work only
878 # for C++-implemented DescriptorPools.
--> 879 return _message.default_pool.AddSerializedFile(serialized_pb)
880 else:
881 return super(FileDescriptor, cls).new(cls)
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "tensorflow/python/saved_model/saved_object_graph.proto":
tensorflow.SavedObjectGraph.nodes: "tensorflow.SavedObjectGraph.nodes" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObjectGraph: "tensorflow.SavedObjectGraph" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject.kind: "tensorflow.SavedObject.kind" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject.children: "tensorflow.SavedObject.children" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject.slot_variables: "tensorflow.SavedObject.slot_variables" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject.user_object: "tensorflow.SavedObject.user_object" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject.asset: "tensorflow.SavedObject.asset" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject.function: "tensorflow.SavedObject.function" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObject: "tensorflow.SavedObject" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedUserObject: "tensorflow.SavedUserObject" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedAsset.asset_file_def_index: "tensorflow.SavedAsset.asset_file_def_index" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedAsset: "tensorflow.SavedAsset" is already defined in file "tensorflow/core/protobuf/saved_object_graph.proto".
tensorflow.SavedObjectGraph.nodes: "tensorflow.SavedObject" seems to be defined in "tensorflow/core/protobuf/saved_object_graph.proto", which is not imported by "tensorflow/python/saved_model/saved_object_graph.proto". To use it here, please add the necessary import.
tensorflow.SavedObject.user_object: "tensorflow.SavedUserObject" seems to be defined in "tensorflow/core/protobuf/saved_object_graph.proto", which is not imported by "tensorflow/python/saved_model/saved_object_graph.proto". To use it here, please add the necessary import.
tensorflow.SavedObject.asset: "tensorflow.SavedAsset" seems to be defined in "tensorflow/core/protobuf/saved_object_graph.proto", which is not imported by "tensorflow/python/saved_model/saved_object_graph.proto". To use it here, please add the necessary import.