Teachable machine 20 or more classes - teachable-machine

Im new in Machine learning, It is possoble to create 20 or more classes in teachable machine?I experienced problem when i convert it in quantized model tflite , but when i convert 5 classes there is no error

Related

Yolov4 error when trying to display image on custom model

I have trained my own model, using my own custom dataset, using Yolov4, and I have downloaded the .cfg, .weights and .data files.
When I try to run my model using:
darknet.exe detector test cfg/obj.data cfg/yolov4-og.cfg custom-yolov4-detector_best.weights
I get the error:
Error: l.outputs == params.inputs filters= in the [convolutional]-layer doesn't correspond to classes= or mask= in [yolo]-layer
I don't know if this is an error on my part, with the command I am running, or an error from the model I trained.
Any help would be appreciated.
I am assuming you are using the main darknet repo AlexeyAB. Please make sure you follow the following instructions:
Make sure you assign the correct classes number in the config file.
Change filters=255 to filters=(classes + 5)x3 in the 3
[convolutional] before each [yolo] layer, keep in mind that it only
has to be the last [convolutional] before each of the [yolo] layers
https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L603
https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L689
https://github.com/AlexeyAB/darknet/blob/0039fd26786ab5f71d5af725fc18b3f521e7acfd/cfg/yolov3.cfg#L776
So if classes=1 then should be filters=18. If classes=2 then write filters=21
(Generally filters depends on the classes, coords and number of masks, i.e. filters=(classes + coords + 1)*, where mask is indices of anchors. If mask is absent, then filters=(classes + coords + 1)*num)
Reference: https://github.com/AlexeyAB/darknet#how-to-train-to-detect-your-custom-objects

Converted tfjs model throwing model config null errors

I am trying to use a converted Keras model (https://github.com/idealo/image-quality-assessment/tree/master/models/MobileNet) in tfjs.
All of the Keras conversion examples mention h5 files, while these are hdf5 files. Is there a difference between them?
When I tried using the converted model I get this error
TypeError: Cannot read property 'model_config' of null
Is there a way to fix this?

How to initialize PYFMI models in parallel?

I am using pyfmi to do simulations with EnergyPlus. I recognized that initializing the individual EnergyPlus models takes quite some time. Therefore, I hope to find a way to initialize the models in parallel. I tried the python library multiprocessing with no success. If it matters, I am on Ubuntu 16.10 and use Python 3.6.
Here is what I want to get done in serial:
fmus = {}
for id in id_list:
chdir(fmu_path+str(id))
fmus[id] = load_fmu('f_' + str(id)+'.fmu',fmu_path+str(id))
fmus[id].initialize(start_time,final_time)
The result is a dictionary with ids as key and the models as value: {id1:FMUModelCS1,id2:FMUModelCS1}
The purpose is to call later the models by their key and do simulations.
Here is my attempt with multiprocessing:
def ep_intialization(id,start_time,final_time):
chdir(fmu_path+str(id))
model = load_fmu('f_' + str(id)+'.fmu',fmu_path+str(id))
model.initialize(start_time,final_time)
return {id:model}
data = ((id,start_time,final_time) for id in id_list)
if __name__ == '__main__':
pool = Pool(processes=cpus)
pool.starmap(ep_intialization, data)
pool.close()
pool.join()
I can see the processes of the models in my system monitor but then the script raise an error because the models are not pickable:
MaybeEncodingError: Error sending result: '[{id2: <pyfmi.fmi.FMUModelCS1 object at 0x561eaf851188>}]'. Reason: 'TypeError('self._fmu,self.callBackFunctions,self.callbacks,self.context,self.variable_list cannot be converted to a Python object for pickling',)'
But I cannot imagine that there is no way to initialize the models in parallel. Other frameworks/libraries than threading/multiprocessing are also welcome.
I saw this answer but it seems that it focuses on the simulations after initialization.
The answer below the one you refer to seems to explain what the problem with multiprocessing and FMU instantiation is.
I tried with pathos suggested in this answer, but run into the same problem:
from pyfmi import load_fmu
from multiprocessing import Pool
from os import chdir
from pathos.multiprocessing import Pool
def ep_intialization(id):
chdir('folder' + str(id))
model = load_fmu('BouncingBall.fmu')
model.initialize(0,10)
return {id:model}
id_list = [1,2]
cpus = 2
data = ((id) for id in id_list)
pool = Pool(cpus)
out = pool.map(ep_intialization, data)
This gives:
MaybeEncodingError: Error sending result: '[{1: <pyfmi.fmi.FMUModelME2 object at 0x564e0c529290>}]'. Reason: 'TypeError('self._context,self._fmu,self.callBackFunctions,self.callbacks cannot be converted to a Python object for pickling',)'
Here is another idea:
I suppose the instantiation is slow because EnergyPlus links plenty of libraries into the FMU. If the components you are modelling all have the same interface (input, output, parameters), you can probably use a single FMU with an additional parameter that switches between the models.
This would be much more efficient: You would only have to instantiate a single FMU and could call it in parallel with different parameters and inputs.
Example:
I have never worked with EnergyPlus, but maybe the following example will illustrate the approach:
You have three variants of a building and you are merely interested in the total heat flux over the entire surface area of buildings as a function of - "weather" (whatever that means - maybe a lot of variables).
Put all three buildings into a single EnergyPlus model and build an if or case clause around them (pseudo code):
if (id_building == 1) {
[model the building one]
elseif (if_building == 2) {
[model the building two]
[...]
Define the "weather" or whatever you need as an input variable for the FMU and define id_building also as a parameter. Define the overall heat flux as output variable.
This would allow you to choose the building before starting the simulation.
The two requirements are:
EnergyPlus Syntax allows if or case structures.
All your models work with the same interface (in our example we have weather as in and a flux as out variables)
There is a dirty workaround for the second requirement: Just define all the variables all your models need and only use what you need in the respective if block.

Delphi 7 how to load data from an ADOQuery to a DBChart at runtime

Im having the following problem with Delphi 7.
I try to use a DBchart to represent some data with a line diagram from a database.
I want the data to be loaded from an ADOQuery that gets activated at runtime thought. I can do it without problem with a query that has a static SQL value, but i find problems at setting the datasource at runtime.
I try to use
dbchart1.series[1].datasource:=ADOQuery3;
After i have created series1, but i get a "list index out of bounds" error.
Am i using the wrong command? I tried several others but failed.
Anyone can give some help with this?
Solved it with the following (after creating series1 at the DBGrid)
with series1 do
begin
datasource:=ADOquery;
xlabelssource:='field1';
YValues.Valuesource:='field2';
checkdatasource;
end;

Core Data: migrating entities with self-referential properties

My Core Data model contains an entity, Shape, that has two self-referential relationships, which means four properties. One pair is a one-to-many relationship (Shape.containedBy <->> Shape.contains) and the another is a many-to-many relationship (Shape.nextShapes <<->> Shape.previousShapes). It all works perfectly in the application, so I don't think self-referencing relationships is a problem in general.
However, when it comes to migrating the model to a new version, then Xcode fails to compile the automatically generated mapping model, with this error message:
2009-10-30 17:10:09.387 mapc[18619:607] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse the format string "FUNCTION($manager ,'destinationInstancesForSourceRelationshipNamed:sourceInstances:' , 'contains' , $source.contains) == 1"'
*** Call stack at first throw:
(
0 CoreFoundation 0x00007fff80d735a4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x00007fff83f0a313 objc_exception_throw + 45
2 Foundation 0x00007fff819bc8d4 _qfqp2_performParsing + 8412
3 Foundation 0x00007fff819ba79d +[NSPredicate predicateWithFormat:arguments:] + 59
4 Foundation 0x00007fff81a482ef +[NSExpression expressionWithFormat:arguments:] + 68
5 Foundation 0x00007fff81a48843 +[NSExpression expressionWithFormat:] + 155
6 XDBase 0x0000000100038e94 -[XDDevRelationshipMapping valueExpressionAsString] + 260
7 XDBase 0x000000010003ae5c -[XDMappingCompilerSupport generateCompileResultForMappingModel:] + 2828
8 XDBase 0x000000010003b135 -[XDMappingCompilerSupport compileSourcePath:options:] + 309
9 mapc 0x0000000100001a1c 0x0 + 4294973980
10 mapc 0x0000000100001794 0x0 + 4294973332
)
terminate called after throwing an instance of 'NSException'
Command /Developer/usr/bin/mapc failed with exit code 6
The 'contains' is the name of one of the self-referential properties. Anyway, the really big problem is that I can't even look at this Mapping Property as Xcode crashes as soon as I select the entity mapping when viewing the mapping model. So I'm a bit lost really where to go from here. I really can't remove the self-referential properties, so I'm thinking I've got manually create a mapping model that compiles? Any ideas?
Cheers
Okay, so it seems as though "contains" might be a reserved word, and as such needs to be escaped using a "#". The Apple docs on migration don't specifically mentions it as a reserved word, although they also don't say what the definitive list is.
But, it seems that a property name cannot be the same as any NSObject or NSManagedObject method name, such as "description", and apparently "contains".

Resources