How to solve assertion error in Google Colab? - file-upload

I'm attempting to write some code to generate a model for 3D segmentation. I'm using a model code provided by the creators of Stardist to write my code but I keep getting an assertion error and I'm not sure how to fix it.
Here is the code provided:
Screenshot of the code from Stardist github page
Here is my attempt at reconstructing the code with the error I get when I attempt to run it.
Screenshot of my code
I was wondering if people had any solutions for the problem I'm getting? I'm almost completely new to coding and using github as a whole so not sure if there's a way to create a direct download link, like they have, or if it should just be able to find my files directly off my hardrive. I also attach a picture of how my files are labelled so can't see why the code can't assertain they have the same labeling:
Image of my pathway for first, the images
and secondly, the masks.
Thank you all,
N

Related

rioxarray.open_rasterio() not recognizing .hdf files

Apologies if this has been asked before. I tried to find an answer elsewhere, but couldn't find a response that resolved my issue.
I inherited some code for downloading and processing satellite data without a lot of explanation and I am required to make it work. The intention was that this code should run without me needing to do anything but run the script, but there is a bug that prevents it from working properly.
I've been able to narrow the issue to (probably) one line of code:
ds = rioxarray.open_rasterio(tempFile).compute()
where tempFile represents a string for an s3 bucket. The exception message I receive about it is as follows: '/MOD13Q1_A2022193_h09v04_061_2022215010516.hdf' not recognized as a supported file format
I have almost no experience with xarray and rasterio, so I don't have a good idea of where to begin to resolve this. The file does exist at the location and rasterio can process .hdf files (I think), but if that's the case, what may be going on here? Any help is appreciated.
Thanks!

Unexpected keyword argument 'show_dtype'

I am trying to plot my model with the data types with the following the code:
plot_model(model, to_file='model/model.png', show_dtype=True, show_shapes=True, show_layer_names=True)
However, I get an error that show_dtype is not an acceptable parameter even though it appears on the TensorFlow documentation: https://www.tensorflow.org/api_docs/python/tf/keras/utils/plot_model
This is the first time that I have run into this issue. It seems that this may be due to having an earlier release if you downloaded it from Anaconda Forge rather than something else like Pip. It is a simple fix, however.
Basically, you need to go into the library source file and edit it to the current version that is shown on the TensorFlow documentation page.
The link to the GitHub page that you will copy the Python code from is here: https://github.com/tensorflow/tensorflow/blob/v2.5.0/tensorflow/python/keras/utils/vis_utils.py#L278-L348
Afterwards, head to your library path and paste that Python code there.
For example, my path is the following: C:/ProgramData/Anaconda3/envs/ml/Lib/site-packages/tensorflow/python/keras/utils/vis_utils.py. Yours should be something similar.

how to fix the problem of downloading fasttext-model300?

I'm using windows 10 and python 3.3. I tried to download fasttext_model300 to calculate soft cosine similarity between documents, but when I run my python file, it stops after arriving at this statement:
fasttext_model300 = api.load('fasttext-wiki-news-subwords-300')
There are no errors or not responding, It just stops without any reaction.
Does anybody know why it happens?
Thanks
I'd recommend against using the gensim api.load() functionality. It dynamically runs new, unversioned source code from remote servers – which is opaque in its operations & suboptimal for maintaining a secure local configuration, or debugging any issues which occur.
Instead, find the actual exact data files you trust and download them as plain data. Then, use specific library operations, like the KeyedVectors.load_word2vec_format() method, so instantiate exactly the model you need, using precise local-file paths you understand.
Following those steps may make it clearer what, if anything, is going wrong. If it doesn't, try also enabling logging at the INFO level to gather more information about what progress is made before failure (and add any new details as a comment or to your question).
python3 -m gensim.downloader --download fasttext-wiki-news-subwords-300
Try using this. Source : https://awesomeopensource.com/project/RaRe-Technologies/gensim-data

404 When Trying to implement Utils in Power BI Custom Visual

I've run into this problem several times when trying to import external libraries to run with a Power BI custom visual, and I'm not really sure what I'm doing wrong. This current attempt is recreating the Card Visual in the latest API, and it's been a painstaking effort that hopefully someone else can help me out with. I can't point at any one reason why this is happening though it appears to be caused by using statements like:
import valueFormatter = powerbi.extensibility.utils.formatting.valueFormatter;
and I get error, in the browser:
Unable to get property 'valueFormatter' of undefined or null reference
visualSandboxMinimal.html (626,17)
when I tried removing these things I instead run into the error:
HTTP404: NOT FOUND - The server has not found anything matching the requested URI (Uniform Resource Identifier).
(XHR)GET - https://app.powerbi.com/13.0.3328.205/visual.js.map;
I can't really resolve either of these errors, to make the project work. The project will build fine and display in the application, but not show any information. Something isn't setup with the API or the project where it just doesn't put the pieces together properly or something. I really don't know and there's so little information out there about this thing, that it's kind of like shouting in the dark at this point.
I am including the whole source project, hopefully so that anyone who can help will be able to, and if anyone wants to take my effort and build their own "Card" like Power BI visual: https://www.dropbox.com/s/9ks8u0v56eph8ul/cardWithConditionalFormatting.zip?dl=0 . This is based on the source available at https://github.com/Microsoft/PowerBI-visuals-core, specifically related to the Card visual.
If anyone figures this out, it would be a huge help to me, though I will continue to do my own research and if I find anything about it I will update the information here.
I figured out what was happening here, I had included the index.d.ts files in the tsconfig.json file, but forgot to include the index.js files in the pbiviz.json file and in some cases forgot to include the css files in the .less file.

how to generate call graph with PC-Lint?

I'm having trouble figuring out how to generate a call graph with PC-lint.
I have tried adding the -vhm flag to pc lint but nothing happens.
Can anyone tell me how to get PC-Lint to generate the call graph?
The -vh option is used to display a graph of the "Strong Type Hierarchy" and the -vm option just prints the names of source code files as they are processed. As of the current version of PC-Lint, there is no way to cause it to display a call graph although there are plenty of other tools that can do this.