def test_ray_tf(sagemaker_session, ray_tensorflow_latest_version,
                cpu_instance_type):
    source_dir = os.path.join(DATA_DIR, "ray_cartpole")
    cartpole = "train_ray.py"

    estimator = RLEstimator(
        entry_point=cartpole,
        source_dir=source_dir,
        toolkit=RLToolkit.RAY,
        framework=RLFramework.TENSORFLOW,
        toolkit_version=ray_tensorflow_latest_version,
        sagemaker_session=sagemaker_session,
        role="SageMakerRole",
        instance_type=cpu_instance_type,
        instance_count=1,
    )
    job_name = unique_name_from_base("test-ray-tf")

    with timeout(minutes=15):
        estimator.fit(job_name=job_name)

    with pytest.raises(NotImplementedError) as e:
        estimator.deploy(1, cpu_instance_type)
    assert "Automatic deployment of Ray models is not currently available" in str(
        e.value)
Exemplo n.º 2
0
def test_ray_tf(sagemaker_session, rl_ray_full_version):
    source_dir = os.path.join(DATA_DIR, 'ray_cartpole')
    cartpole = 'train_ray.py'

    estimator = RLEstimator(entry_point=cartpole,
                            source_dir=source_dir,
                            toolkit=RLToolkit.RAY,
                            framework=RLFramework.TENSORFLOW,
                            toolkit_version=rl_ray_full_version,
                            sagemaker_session=sagemaker_session,
                            role='SageMakerRole',
                            train_instance_type=CPU_INSTANCE,
                            train_instance_count=1)

    with timeout(minutes=15):
        estimator.fit()

    with pytest.raises(NotImplementedError) as e:
        estimator.deploy(1, CPU_INSTANCE)
    assert 'Automatic deployment of Ray models is not currently available' in str(e.value)