Loading R package iZID for simulating zero-inflated distribution - r-package

I am currently working on a project on zero-inflated models. I wish to simulate a sample of zero-inflated poisson distribution. When I type
install.packages("iZID")
library(iZID)
I got following error:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()),
versionCheck = vI[[j]]) :
namespace 'foreach' 1.4.4 is already loaded, but >= 1.4.7 is required
Error: package or namespace load failed for 'iZID'

Related

Integration of EfficientNet TensorFlow lite model with iOS swift

I am performing object detection using EfficientNet .tflite model in iOS which we trained using the model maker library of TensorFlow. I am integrating this model inside the Official ObjectDetection Sample Application, but while integration i get this error
2022-05-27 16:47:09.401469+0400 ObjectDetection[13225:488954] Initialized TensorFlow Lite runtime.
Failed to invoke the interpreter with error: Provided data count 270000 must match the required count 307200.
Failed to invoke the interpreter with error: Provided data count 270000 must match the required count 307200.
Failed to invoke the interpreter with error: Provided data count 270000 must match the required count 307200.
Failed to invoke the interpreter with error: Provided data count 270000 must match the required count 307200.
So changed the code in ModelDataHandler.swift into the following:
let batchSize = 1
let inputChannels = 3
let inputWidth = 320
let inputHeight = 320
However, when I tried to run the app, it crashed and gave the following error:
2022-05-28 00:05:40.099286+0400 ObjectDetection[13413:503427] Initialized TensorFlow Lite runtime.
Swift/ContiguousArrayBuffer.swift:575: Fatal error: Index out of range
2022-05-28 00:05:43.025412+0400 ObjectDetection[13413:503623] Swift/ContiguousArrayBuffer.swift:575: Fatal error: Index out of range
The error is throwing from the code in ModelDataHandler.swift line 203:
I really appreciate any help.

TensorflowJS TFJS error: The dtype of dict

Had tried to run https://glitch.com/~tar-understood-exoplanet
and the model would fail to load and I wouldn't be able to use enable the webcam.
Anyone had the same issue?
While the program is running, in the console I get the following:
tfjs:2 Uncaught (in promise) Error: The dtype of dict['image_tensor'] provided in model.execute(dict) must be int32, but was float32
at Object.b [as assert] (tfjs:2)
at tfjs:2
at Array.forEach (<anonymous>)
at t.checkInputShapeAndType (tfjs:2)
at t.<anonymous> (tfjs:2)
at tfjs:2
at Object.next (tfjs:2)
at tfjs:2
at new Promise (<anonymous>)
at Zv (tfjs:2)
I have a Macbook Pro and some other people on their Windows also had some issues running the model. We also tried it on different browsers, Safari and Chrome.
SUCCESS! after switching to coco-ssd 2.0.2:
I added the version 2.0.2 in line 62 as follows:
<script src="https://cdn.jsdelivr.net/npm/#tensorflow-models/coco-ssd#2.0.2"></script>
This is caused by the warmup run of coco-ssd that uses tf.zeros tensor. The default dtype for tf.zeros is 'float' in the recent release of TFJS.
I have put out a new version with fixes. It should work if you use the latest version of coco-ssd (2.0.2) in the glitch example (index.html) as following.
<!-- Load the coco-ssd model to use to recognize things in images -->
<script src="https://cdn.jsdelivr.net/npm/#tensorflow-models/coco-ssd#2.0.2"></script>
Same error here, just occured since Friday night (04/03/2020)
TFModel works well in past few weeks.
I got the same error.
My Scenerio:
I trained a pre-trained model from tensorflow model zoo using transfer learning using tensorflow api as saved model (model.pb file) and converted it into tfjs format (model.json and shared .bin files).
When I tried running this model.json on the javascript(web), it gives the below error:
Uncaught (in promise) Error: The dtype of dict['input_tensor'] provided in model.execute(dict) must be int32, but was float32
When I tried someone else's working converted model (model.json and shared .bin files) on my javascript(web), it worked.
Conclusion:
There is something wrong with my converted model. I converted it using tensorflowjs_converter. My original model in (model.pb) works accurately in python too.
I'm still trying out to convert my model.pb file with different tensorflowjs_converters as it seems to be the converters versioning issue.

Unreal HandheldAR template: Couldn't find file for package /Script/AugmentedReality requested by async loading code

I've created an unmodified project using the HandheldAR template, and deployed it to an iPad after building via a remote Mac build server (while it's a Blueprint-only project, a Mac is still required to build AR application).
Project builds and deploys to the device without errors, and certificates report that they're valid, but when I attempt to launch it on the iPad, the default project splashscreen appears, and then the device dumps back to the home screen. Application still appears as a running app, but if I attempt to switch back to it, it just bounces back to the home screen.
Other Blueprint-only UE4 projects deployed from the same machine work as expected on the device.
From the log below, it appears that /Script/AugmentedReality failed to load.
[2018.08.03-17.56.36:622][ 0]LogAIModule: Creating AISystem for world
HandheldARBlankMap [2018.08.03-17.56.36:625][ 0]LogStreaming: Error:
Couldn't find file for package /Script/AugmentedReality requested by
async loading code. NameToLoad: /Script/AugmentedReality
[2018.08.03-17.56.36:625][ 0]LogStreaming: Error: Found 1 dependent
packages... [2018.08.03-17.56.36:625][ 0]LogStreaming: Error:
/Game/HandheldARBP/Blueprints/GameFramework/BP_ARPawn
[2018.08.03-17.56.36:628][ 0]LogStreaming: Error:
****DumpDependencies [Dependencies]: [2018.08.03-17.56.36:628][ 0]LogStreaming: Error: Export 1
/Game/HandheldARBP/D_ARSessionConfig.D_ARSessionConfig
[2018.08.03-17.56.36:628][ 0]LogStreaming: Error: Linker is
../../../HandheldAR/Content/HandheldARBP/D_ARSessionConfig.uasset
[2018.08.03-17.56.36:628][ 0]LogStreaming: Error: Dep
S_BEFORE_C Import 1 /Script/AugmentedReality.ARSessionConfig
[2018.08.03-17.56.36:628][ 0]LogStreaming: Error: Dep
S_BEFORE_C Import 0
/Script/AugmentedReality.Default__ARSessionConfig
[2018.08.03-17.56.36:628][ 0]LogStreaming: Error: Missing Dependency,
request for /Script/AugmentedReality.ARSessionConfig but it hasn't
been created yet. [2018.08.03-17.56.36:628][ 0]LogStreaming: Error:
Could not find class ARSessionConfig to create D_ARSessionConfig
[2018.08.03-17.56.36:633][ 0]LogProperty: Error: Struct type unknown
for property 'StructProperty
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:UpdateDebugMenuInfo.CallFunc_GetARSessionStatus_ReturnValue';
perhaps the USTRUCT() was renamed or deleted?
[2018.08.03-17.56.36:633][ 0]LogProperty: Error: Struct type unknown
for property 'StructProperty
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:ToggleARMode.CallFunc_GetARSessionStatus_ReturnValue';
perhaps the USTRUCT() was renamed or deleted?
[2018.08.03-17.56.36:633][ 0]LogProperty: Error: Struct type unknown
for property 'StructProperty
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:InitializeDebugButtonStates.CallFunc_GetARSessionStatus_ReturnValue';
perhaps the USTRUCT() was renamed or deleted?
[2018.08.03-17.56.36:634][ 0]LogProperty: Error: Struct type unknown
for property 'StructProperty
/Game/HandheldARBP/Blueprints/GameFramework/BP_ARPawn.BP_ARPawn_C:ExecuteUbergraph_BP_ARPawn.CallFunc_LineTraceTrackedObjects_ReturnValue.CallFunc_LineTraceTrackedObjects_ReturnValue';
perhaps the USTRUCT() was renamed or deleted?
[2018.08.03-17.56.36:639][ 0]LogLoad: Game class is 'BP_ARGameMode_C'
[2018.08.03-17.56.36:640][ 0]LogWorld: Bringing World
/Game/HandheldARBP/Maps/HandheldARBlankMap.HandheldARBlankMap up for
play (max tick rate 0) at 2018.08.03-10.56.36
[2018.08.03-17.56.36:640][ 0]LogWorld: Bringing up level for play
took: 0.000401 [2018.08.03-17.56.36:640][ 0]LogGameMode:
FindPlayerStart: PATHS NOT DEFINED or NO PLAYERSTART with positive
rating [2018.08.03-17.56.36:642][ 0]LogUMG: Display: Widget Class
BP_MainMenu_C - Loaded Fast Template. [2018.08.03-17.56.36:643][
0]LogUMG: Display: Widget Class BP_DebugMenu_C - Loaded Fast Template.
[2018.08.03-17.56.36:644][ 0]LogScript: Warning: Accessed None
BP_DebugMenu_C
/Engine/Transient.GameEngine_0:GameInstance_0.BP_DebugMenu_C_0
Function
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:InitializeDebugButtonStates:001C
[2018.08.03-17.56.36:644][ 0]LogScript: Warning: Script call stack:
Function
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:Construct
Function
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:ExecuteUbergraph_BP_DebugMenu
Function
/Game/HandheldARBP/Blueprints/UI/BP_DebugMenu.BP_DebugMenu_C:InitializeDebugButtonStates
[2018.08.03-17.56.36:644][ 0]LogOutputDevice: Warning:
Script Stack: BP_DebugMenu_C.InitializeDebugButtonStates
BP_DebugMenu_C.ExecuteUbergraph_BP_DebugMenu BP_DebugMenu_C.Construct
BP_ARPawn_C.ExecuteUbergraph_BP_ARPawn BP_ARPawn_C.ReceiveBeginPlay
iPad specs:
Capacity: 64 GB, Available: 51.35 GB
Version: 11.4.1 (15G77)
Model: MQDT2LL/A (Apple 10.5" iPad Pro (64GB, Wi-Fi, Space Gray))
It appears that the answer was simply that the Apple ARKit plugin was not enabled. Enabling it and rebuilding corrected the issue.

Parse errror: version mismatch between Agda and its standard library

I'm running the prebuilt Windows Agda version 2.4.2.2. In Emacs/Agda2 Include Dirs I have identified c:/agda-stdlib-0.13/src and the folders one level below.
Upon loading a module which consists only these two lines, I get an error message.
module test1 where
open import Integer
The error message:
C:\agda-stdlib-0.13\src\Data\Empty.agda:13,5-5
C:\agda-stdlib-0.13\src\Data\Empty.agda:13,5: Parse error
HASKELL<ERROR> data AgdaEmpty #-} {-# COMPIL...
Is something missing from the proper installation of the library?
Your Agda is old. See this page for library compatibility. You need Agda 2.5.2 for this library.

How to compile my c program which uses opencv

I have started learning OpenCV.
I am working on linux.
From their documentation page I was able to compile this
http://docs.opencv.org/doc/tutorials/introduction/linux_gcc_cmake/linux_gcc_cmake.html#linux-gcc-usage
However after that I got lost in trying to declare a new mat and it's constructors.
SO I decided to go with this book http://www.amazon.com/Learning-OpenCV-Computer-Vision-Library/dp/0596516134
However I am not able to compile the very first program from this book.
The program is here :
#include "highgui.h"
int main(int argc, char** argv)
{
IplImage* img = cvLoadImage (argv[1]);
cvNamedWindow("Example1", CV_WINODW_AUTOSIZE);
cvShowImage("Example1",img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("Example1");
}
I saved this in a file named load.c
Then I created a CMakeLists.txt file and put this in it :
project( load )
find_package( OpenCV REQUIRED )
add_executable( load load )
target_link_libraries( load ${OpenCV_LIBS} )
when running "cmake ." from terminal it is succesful. But when I am running "make" it gives me this error :
Scanning dependencies of target load
[100%] Building C object CMakeFiles/load.dir/load.o
/home/ishan/load/load.c: In function ‘main’:
/home/ishan/load/load.c:4:2: error: too few arguments to function ‘cvLoadImage’
/usr/local/include/opencv2/highgui/highgui_c.h:212:18: note: declared here
/home/ishan/load/load.c:5:28: error: ‘CV_WINODW_AUTOSIZE’ undeclared (first use in this function)
/home/ishan/load/load.c:5:28: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [CMakeFiles/load.dir/load.o] Error 1
make[1]: *** [CMakeFiles/load.dir/all] Error 2
make: *** [all] Error 2
I think it is because this example in the book is for OpenCV 1.x while I am currently running 2.4.3, however I believe there must be a way to run this program and the subsequent program that are in the book.
I think the problem lies with linking the header files properly.
I would like to first read from the book and using reference from documentation and then switch to documentation fully. But for now I wish to learn from the book as learning from the book is far easier to me than documentation. Plus I bought this book for approx 3000 INR and got it just today, I don't want to see it go to waste. I want to learn from it.
Please help me out.
CV_WINODW_AUTOSIZE is mispelled. The correct constant is CV_WINDOW_AUTOSIZE
cvLoadImage (argv[1]); should be cvLoadImage (argv[1], 1); (for loading a color image) because the C standard does not support default arguments.
By the way, if you're using OpenCV 2.0+, I recommend learning the C++ API. It's a lot less convoluted than the C API and performance is comparable.

Resources