Attribute Error for pytorch_forecasting models - time-series

I'm currently trying to set up a TemporalFusionTransformer from the pytorch_forecasting library in Google Colab, following the exact approach that is stated here.
For some reason, I always get "AttributeError: 'tuple' object has no attribute 'items'" when trying to set up a model.
Even if I just try initializing a default model in the Baseline class, I get the same error (see screenshot).
Error message for Baseline model
Maybe someone knows how to solve this issue here. Thanks in advance.
What I tried so far:
converted my data into a TimeSeriesDataSet object
used TemporalFusionTransformer.from_dataset(...) providing my data as well as some training parameters
tried the same without providing the training parameters
tried setting up the TFT with and without training parameters (i.e. TemporalFusionTransformer(...))
tried the same with the Baseline model (Baseline())
result was an Attribute error in all cases

Related

YoloV8 Instance Segmentation Model Deployment to Roboflow Error: InvalidDatasetException Dataset is not of the correct type

I am using YOLOV8 for instance segmentation using Google Colab. Now, after I download, train, validate, and test my dataset from Roboflow, I want to upload my model/weights to a specific project version to use it as my API. I follow their documentation upon deploying it, but I got an error due to the method is only for object detection type. I would really appreciate your attention.
This is my code looks like
and this is what it looks like when I open the link.
message upon clicking the link
Code Snippet: project.version(2).deploy(model_type="yolov8", model_path=f"/content/drive/MyDrive/PATH/model/runs/segment/train4/")
Error Snippet: { "message": "Dataset is not of the correct type.", "type": "InvalidDatasetException", "hint": "This method can only be used on object detection datasets." }
I already applied the methods in the following articles but still I got the same error.
https://roboflow.com/deploy
https://docs.roboflow.com/upload-weights
Model weights uploads are only available for object detection models from YOLOv8 at this time. I've just made an update to the blog post to make it a bit more clear.
I do want to add that it was already added to the documentation when the feature was released.
https://docs.roboflow.com/upload-weights#upload-yolov8-model-weights

Code by Zapier - Input data field losing information when trying to execute code

I am using code by zapier, javascript.
I've used before and never had problems.
But today, as I am trying to create a new zap, I am reading data from trello and then trying to process the data with code by zapier.
I am filling data coming from trello in the field "Input Data", and then, trying to read the input data in my code using:
var cards = inputData['cards'].split(",");
The problem is that when I test the code, I receive an error:
TypeError: Cannot read property 'split' of undefined
When I go to check the Input Data field, it is losing the information.
Even if I type again, the Input Data information is not storing what I am asking there.
Any ideas?
Thank you
Amanda
Thank you everyone. I haven’t changed a thing.
I’ve tried in the next day with the same zap and that initial code that I posted.
Zapier was cleaning out the field with the data input from Trello (wasn’t detaining the value to pass to the next step).
Now it’s working. As I tried with different browsers on the same day and it was equally not working, I believe it was a bug that was fixed.

Rails validation fails but object memory remains unchanged?

First time user long time reader. I have thoroughly looked for an explanation for the problem I'm having via the mighty search engine Google, but alas I have failed to produce any significant insight.
I need to be able to ensure that a model form is not reloaded with invalid data. Since the model stored in memory on the server is edited directly with the parameters of the web form first, and THEN checked for validity, without additional code invalid model data will ALWAYS be sent back to the form. This is less than desirable to me. My question is this: how do I ensure this doesn't happen?
What I'm thinking is I need some mechanism for saving the state of the object before it's modified with the parameters sent from the web form, and then after a failed validation restore the object to it's previous, correct and unmodified state of being.
Help!
Thanks,
Les
The object isn't actually modified in the db if validation fails, even though the object is in an invalid state in the form ... the thinking behind this is that the user wants to see the errors they made so they can correct them.
If you don't want that to be the case, then just read back the object with a WhateverObject.find(x) and assign it to the variable that the form is referencing and it will 'restore' the object to its previous unmodified state.
To add to what concept47 said you can also get the value for a particular field using
object.field_was
Have a look at ActiveRecord::Dirty for details (http://ar.rubyonrails.org/classes/ActiveRecord/Dirty.html)
Using that you could retrieve the original values for just those fields that had validation errors.

Removing ModelErrors from ModelState once written to ValidationSummary()

I may be approaching this from the wrong angle entirely, but hopefully someone will know a way of acheiving what I'm after.
I reference a web service, which returns an ErrorInfo object. I add each returned error to the ModelState as a ModelError:
foreach(ErrorInfo error in serviceResponse)
ModelState.AddModelError(error.AssociatedField, error.Description);
For errors which relate to a particular input field (using strongly-typed Views here), I get a nice inline error returned to Html.ValidationMessageFor(x), which is great.
The problem is that in addition to these input-related errors, there may also be more generate results.
What I'd LIKE to do is have these output in a list similar to Html.ValidationSummary() - however if I do this at the moment, it will also include the errors which have already been displayed inline against each input.
Is there an elegant way of just displaying all the errors which DON'T relate to a particular form input?
This is a good enough solution for me, it doesn't print the individual error detail, but thats not important for the non-input related errors
Html.ValidationSummary(true, "Failed to login for some other reason")

The 'invalid field type' error with TClientDataSets I don't understand

I use nested database stuctures with TClientDataSets. I'm new to programming so my lingo is ten-to-one wrong.
My problem is as follows: I defined my database stucture and all the fields of the nested stuctures and then I called the CreatDataSet method of the master clientDataSet and it worked. I then wanted to add another data field to the master ClientDataSet. I then called the ClearData method of the Master ClientDataSet and then tried to create the new stucture by calling CreateDataSet again. It is here where I encounter my problem. I get the 'Invalid field type error' and I don't really know or understand what what the problem is.
So how do I create an exsta field after I called the createdata set method, then called the cleardata method, then added a field and then calling the createdataset method again without getting the 'invalid field type error?
Does anybody have any information about this problem. I use Delphi 2007
Kind Rgards
Riaan de Villiers
It is a Delphi bug.
Call YourDataset.FieldDefs.Clear before calling CreateDataSet and it should work.
For more infomation please look at this QC Report:
http://qc.codegear.com/wc/qcmain.aspx?d=38984
EDIT:
After reading your problem more carefully, the problem might be something else, but please try the FieldDefs.Clear and let me know the results.
It has been a long time since you asked this question, but I believe the problem has specifically to do with the nested dataset fields. I've seen this error before, and I believe that it has to do with the order in which the particular fields are created. If I remember correctly, if you try to create the master dataset before the nested dataset fields are defined or created, you get this invalid field type error.
Begin by removing your nested dataset fields from the equation and see if you still get the problem. If not, then add them back. Try creating the master dataset and its nested datasets in different orders.
I know this is late, but I hope it helps.

Resources