AWS SageMaker Pipeline Issue - Pipeline variables do not support __str__ operation - amazon-sagemaker

I'm trying to build SageMaker Pipeline based on Tensorflow framework. I have only Training, Evaluating steps, and Register model. On the evaluation step I declared MetricsSource for ModelMetrics and received an error.
Code is below:
pipeline_model = PipelineModel(
models=[tf_model],
role=role,
sagemaker_session=sagemaker_session
)
eval_res = step_evaluate_model.arguments['ProcessingOutputConfig']['Outputs'][0]['S3Output']['S3Uri']
evaluation_s3_uri = f'{eval_res}/evaluation.json'
model_statistics=MetricsSource(
s3_uri=evaluation_s3_uri,
content_type='application/json')
model_metrics = ModelMetrics(model_statistics=model_statistics)
step_register_pipeline_model = pipeline_model.register(
content_types=['application/json'],
response_types=['application/json'],
inference_instances=['ml.m4.xlarge','ml.c5.2xlarge'],
transform_instances=['ml.c5.2xlarge'],
model_package_group_name=model_package_group_name,
model_metrics=model_metrics,
approval_status=model_approval_status.default_value,
)
Error:
TypeError Traceback (most recent call last)
Input In [17], in <cell line: 17>()
14 model_metrics = ModelMetrics(model_statistics=model_statistics)
15 # print('\n',pipeline_model)
---> 17 step_register_pipeline_model = pipeline_model.register(
18 content_types=['application/json'],
19 response_types=['application/json'],
20 inference_instances=['ml.m4.xlarge','ml.c5.2xlarge'],
21 transform_instances=['ml.c5.2xlarge'],
22 model_package_group_name=model_package_group_name,
23 model_metrics=model_metrics,
24 approval_status=model_approval_status.default_value,
25 )
TypeError: Pipeline variables do not support __str__ operation. Please use `.to_string()` to convert it to string type in execution timeor use `.expr` to translate it to Json for display purpose in Python SDK.
Could you please help me to solve it? I'd appreciate for any idea. Thanks

They way to create model and register model on Pipelines has changed slightly with the introduction of ModelStep, also the instantiation of session_pipeline is needed. Similarly, ModelStep will be used for registering the model .
Reference: https://github.com/aws/sagemaker-python-sdk/pull/3076
Examples : https://sagemaker.readthedocs.io/en/stable/workflows/pipelines/sagemaker.workflow.pipelines.html?highlight=ModelStep#sagemaker.workflow.model_step.ModelStep

Related

What IBM_Q backend supports Qiskit Pulse?

I was doing an experiment with open pulse on caliberation of a qubit and I stumbled upon this error:
Traceback (most recent call last):
Input In [73] in <cell line: 1>
frequency_sweep_results = job.result(timeout=120) # timeout parameter set to 120 seconds
File /opt/conda/lib/python3.8/site-packages/qiskit/providers/ibmq/job/ibmqjob.py:290 in result
raise IBMQJobFailureError(
IBMQJobFailureError: 'Unable to retrieve result for job 627bcffafd267c3dbc4f42f7. Job has failed: The Qobj pulse type is not supported by the selected backend. Error code: 1108.'
Error code 1108 being :
Run the job on a backend that supports open pulse. Whether a backend supports open pulse can be found in its configuration data.
Use %tb to get the full traceback
I have used ibmq_santiago,ibmq_manila and ibmq_lima so far all giving me the same error.
Could someone suggest a backend that supports qiskit pulse?
You can check out the backends with pulse support in the table view of IBM service list:
Programmatically, you can list the backends with pulse support you have access to in the following way:
from qiskit import IBMQ
provider = IBMQ.load_account()
backends_supporting_openpulse = provider.backends(filters=lambda b: b.configuration().open_pulse)

OpenSSL 3.0.2: SSL_CTX_use_certificate_chain_file returns error:03000072:digital envelope routines::decode error

When upgrading from OpenSSL 1.1.0 to 3.0.2 an error is being logged when using
SSL_CTX_use_certificate_chain_file.
For example, here's pseudo code that shows a series of successful calls where 1.1.0h succeeds but 3.0.2 fails.
OpenSSL 1.1.0h
method=TLS_method()
ctx=SSL_CTX_new(method)
SSL_CTX_use_certificate_chain_file(ctx,"domain.crt")
---> Returns 1
OpenSSL 3.0.2
fips_libctx=OSSL_LIB_CTX_new()
OSSL_LIB_CTX_load_config(fips_libctx,"C:\Program Files\MyServer\openssl.cnf")
OSSL_PROVIDER_load(NULL,"fips")
method=TLS_method()
ctx=SSL_CTX_new_ex(fips_libctx,NULL,method)
SSL_CTX_use_certificate_chain_file(ctx,"domain.crt")
---> error:03000072:digital envelope routines::decode error
---> error:0A00018F:SSL routines::ee key too small
Question
Any ideas why SSL_CTX_use_certificate_chain_file would fail for 3.0.2 but work fine in 1.1.0?
Got it working with the suggestion from Matt at OpenSSL.
You need to also load the base provider. It is designed to be used in
conjunction with the FIPS provider and does not include any
cryptographic algorithms (only encoders and decoders). See the fips
module guide for a discussion about this:
https://www.openssl.org/docs/man3.0/man7/fips_module.html
The FIPS module does not include any decoders itself - which explains
the "decode error" that you are seeing.
As he noted, I wasn't loading the "base" provider in openssl.cnf, so I added this call
OSSL_PROVIDER_load(NULL,"base")
and modified the openssl.cnf to include the base provider section
which allowed the decoder to work on the cert file
config_diagnostics = 1
openssl_conf = openssl_init
[openssl_init]
providers = provider_sect
[provider_sect]
fips = fips_sect
base = base_sect
[base_sect]
activate = 1
[fips_sect]
activate = 1
install-version = 1
conditional-errors = 1
security-checks = 1
module-mac = 3A:EC:2E:53:3F:92:44:F9:50:13:70:6E:FD:38:37:08:8B:F2:68:56:CC:B4:ED:5F:A1:52:1B:93:15:37:0B:8C
Also, seeing as the value "activate = 1" is set for both fips and base,
I probably don't need any calls to OSSL_PROVIDER_load() since this takes care of it
OSSL_LIB_CTX_load_config(fips_libctx,"C:\Program Files\MyServer\openssl.cnf")

Sitecore 8.2 update 5 Ninject Solr support package issue

I am facing an issue with Ninject IOC container.
I am using Sitecore 8.2 update 5 and switching from Lucene to Solr search engine using the steps mentioned in https://sitecorerockz.wordpress.com/2018/08/01/lucene-to-solr/
I am using Solr 6.6.3. Earlier this project was on Sitecore 6.X version and from time to time some upgrades happened, and now it is in Sitecore 8.2 update 5.
The same Solr setup is working fine for the fresh Sitecore 8.2 update 5 setup.
I created Solr diagnostic page and kept it in /Sitecore/admin folder to check the error details, I am getting the below error for all the indexes:
Solr Indexes Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ISolrOperations`1, key "sitecore_analytics_index" ---> Ninject.ActivationException: Error activating ISolrOperations{Dictionary{string, Object}} No matching bindings are available, and the type is not self-bindable. Activation path: 1) Request for ISolrOperations{Dictionary{string, Object}} Suggestions: 1) Ensure that you have defined a binding for ISolrOperations{Dictionary{string, Object}}. 2) If the binding was defined in a module, ensure that the module has been loaded into the kernel. 3) Ensure you have not accidentally created more than one kernel. 4) If you are using constructor arguments, ensure that the parameter name matches the constructors parameter name. 5) If you are using automatic module loading, ensure the search path and filters are correct. at Ninject.KernelBase.Resolve(IRequest request) in c:\Projects\Ninject\ninject\src\Ninject\KernelBase.cs:line 376 at Ninject.ResolutionExtensions.Get(IResolutionRoot root, Type service, String name, IParameter[] parameters) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line 164 at MyLibrary.test.Infrastructure.NinjectServiceLocator.DoGetInstance(Type serviceType, String key) in C:\test_Git\Sitecore\src\test\Infrastructure\NinjectServiceLocator.cs:line 15 at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 49 --- End of inner exception stack trace --- at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 53 at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService](String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 103 at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() at ASP._Page_sitecore_admin_solr_diagnostic_cshtml.Execute() in c:\test_Git\Sitecore\build\25Sep2019\Website\sitecore\admin\solr-diagnostic.cshtml:line 29
What am I missing, could you please advise me?
The SetLocatorProvider was getting initialized two times
Modified the Custom code related to Ninject IOC
Our current solution was using Ninject.dll 3.0.0.0 now I used new version of Ninject.dll which is 3.2.2.0 under folder bin>>Social
Replaced all the Solr dll files from fresh Sitecore 8.2 update 5 files

xmlrpc.client.Fault when calling TestRun.update()

Kiwi version 6.0, tcms-api 5.0.
Given that 82 is a valid test run_id and 7 is a valid build_id for the test run's product in the Kiwi instance, run this Python snippet:
from tcms_api import TCMS
kiwi = TCMS()
kiwi.exec.TestRun.update(82, {'build' : 7})
Expect:
The test run's product build is updated from 1 (unspecified) to 7.
Result:
Exception has occurred: xmlrpc.client.Fault
<Fault -32603: "Internal error: 'status'">
There's no other call stack information, so I'm at a loss to further debug. I've tried updating a couple of different fields (manager and status) with the same result. I also get the same result if the value I'm trying to update is unknown/invalid.
Additional information: the equivalent call to TestCaseRun.update() API works. I.e., I can update the build information on a TestCaseRun instance.
#s-manke. This is a genuine bug. I've implemented a hot-fix here: https://github.com/kiwitcms/Kiwi/pull/553
so you can at least continue to use the API.
I am in the process of cutting a new version anyway so this hot-fix will go in. However the API will not process status or stop_date fields at the moment.

How to configure Search plugin in Cakephp 2.0

I was trying to incorporate Search plugin to my project and I thought I followed the instructions from the download site but whenever I access Posts it gives me these 3 lines of errors:
Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'PrgComponent' does not have a method 'startup' [CORE\Cake\Utility\ObjectCollection.php, line 110]
Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'PrgComponent' does not have a method 'beforeRender' [CORE\Cake\Utility\ObjectCollection.php, line 110]
Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'PrgComponent' does not have a method 'shutdown' [CORE\Cake\Utility\ObjectCollection.php, line 110]
Can someone help me figure this out please?
Thanks!
In Cakephp 2.0 component class extents Component not Object
So, write following code:
class PrgComponent extends Component {
}
Download site? Which download site? There is no "download site" for the 2.0 version of this plugin yet.
The 2.0 branch is here https://github.com/CakeDC/search/tree/2.0 and all tests for the PrgComponent pass.
9/9 test methods complete: 9 passes, 0 fails, 13 assertions and 0 exceptions.
Time: 0.29582810401917 seconds
Peak memory: 11,688,424 bytes
Run more tests | Show Passes | Analyze Code Coverage
Code coverage results Toggle all files
PrgComponent.php Code coverage: 99.06%
Check the 2.0 branch out from git.
Are you even talking about the CakeDC search plugin?

Resources