fishcharlie

joined 3 years ago
MODERATOR OF
 

cross-posted from: https://eventfrontier.com/post/3318203

I recently upgraded to Xcode 26.4. However, whenever I go to download the iOS, watchOS, tvOS, and visionOS platforms, it says "Status unavailable".

I tried to uninstall Xcode. I tried to delete ~/Library/Xcode and reinstall Xcode. I restarted my computer. I tried to install it using Xcodes.app.

I also tried the following command: xcodebuild -downloadPlatform iOS. But that gave me the following error:

Finding content...
Unable to connect to simulator.

I also looked at this repository (https://github.com/filsv/iOSDeviceSupport) to see if I could manually download the files and move them to the correct directory, but they don't have the recent files.

I'm really at a loss for what to do next here.

How can I fix this and download the platform support files?

Screenshot of Xcode Components Platform Support showing "Status unavailable" for each platform

 

Last month I was swept up in ForeFlight's massive layoffs. I wrote about my experiences with AI in software development, what I think this means for the future, and why I have concerns.

 

Last month I was swept up in ForeFlight's massive layoffs. I wrote about my experiences with AI in software development, what I think this means for the future, and why I have concerns.

[–] fishcharlie@eventfrontier.com 3 points 9 months ago

Most dash cameras that have an SD card slot just record over existing footage once it runs out of storage.

So get a large-capacity SD card. Have it record everything. Then every so often, take that SD card, put it into your laptop, and offload it wherever you want (NAS, cloud storage, etc.).

 

Echo v1.7 has been released, featuring Echo AI (in beta) and iOS 26 support!

Although Echo AI is still in its early stages and in beta, we have a comprehensive roadmap for its development and are eager to continuously improve it.

As always, we value your feedback.

Below are the complete release notes.

- Echo AI (Beta)
    - Summarize posts using Echo AI with server-based models or Apple Intelligence models
    - Apple Intelligence requires iOS 26.0 and a supported device
- iOS 26.0 support
    - Liquid Glass redesign
    - Apple Intelligence summarizes
- General bug fixes, performance improvements, and behind the scenes improvements.
 

Echo v1.6 has been released with support for searching Reddit communities.

Simply navigate to the Explore tab and enter a subreddit name (e.g., r/technology) or a link to the subreddit to find Lemmy community alternatives.

This is only the beginning. Stay tuned for more!

Below are the full release notes.

- Introducing: Search Reddit Communities
    - Have a favorite community on Reddit and want to find similar Lemmy communities? Simply search for the community in the Explore tab, and see similar Lemmy communities.
    - For example, search for `r/apple` or `r/worldnews`.
- General bug fixes, performance improvements, and behind the scenes improvements.

Screenshot of a search in Echo showing the query “r/technology” in the search bar. Under the “Communities” section, a single result appears: a community named “Technology” with a yellow hexagon icon featuring a black microchip symbol.

 

I'm trying to train a machine learning model to detect if an image is blurred or not.

I have 11,798 unblurred images, and I have a script to blur them and then use that to train my model.

However when I run the exact same training 5 times the results are wildly inconsistent (as you can see below). It also only gets to 98.67% accuracy max.

I'm pretty new to machine learning, so maybe I'm doing something really wrong. But coming from a software engineering background and just starting to learn machine learning, I have tons of questions. It's a struggle to know why it's so inconsistent between runs. It's a struggle to know how good is good enough (ie. when should I deploy the model). It's a struggle to know how to continue to improve the accuracy and make the model better.

Any advice or insight would be greatly appreciated.

View all the code: https://gist.github.com/fishcharlie/68e808c45537d79b4f4d33c26e2391dd

 

Echo v1.5 has been released with support for uploading images as part of your Echo post.

This release also includes support for Apple's new Apple Intelligence Image Playground feature. Generate new images based on an existing image or create a brand new image of anything you want. Echo has also created a new Lemmy community for Image Playground Showcase: !ip_showcase@eventfrontier.com. Be sure to join and post all your best (or worst) Image Playground images.

We aren't done yet! Much more coming soon. We are committed to building the best, native first, Lemmy experience for iOS.

Below are the full release notes.

- Support for uploading image in post.
    - Requires your Lemmy instance to support pictrs at the default URL.
- Adds support for Image Playground. Generate image from an existing image or create a new image using Apple Intelligence.
    - Requires iOS 18.2, an Apple Intelligence supported device, and access to be granted to Image Playground.
- Fixes an issue where reply & bookmark options wouldn't show up in comment ellipsis menu.
- Fixes an issue where sometimes when closing a screen multiple screens would close unintentionally.
- Fixes an issue where sometimes avatar images would not display correctly.
- General bug fixes, performance improvements, and behind the scenes improvements.
 

Super happy to announce the release of multiple account support in Echo v1.4! Easily change between Lemmy accounts (even across multiple instances/servers) in Echo without having to logout of your existing account.

The full release notes are listed below.

- Multiple Account support!
    - Do you have multiple Lemmy accounts? Maybe across multiple instances? Well now you can sign into all of them in Echo without having to logout of your existing account.
    - Requires Echo+ subscription.
- Fixes issue where community list would flash results when opening.
- Adds loading indicator to Explore page after searching.
- Lemmy 0.19.6 support & improvements.
- Fixes issue where in rare cases deleted/removed communities would show in the community list.
- Vast performance improvements.
- More behind the scenes improvements than we can count.
 

It seems like running a pictrs server is optional when running Lemmy. I'm trying to figure out if a given instance supports pictrs.

I see in the documentation for pictrs, there is a GET /healthz endpoint. However when I try to access https://lemmy.ml/pictrs/healthz for example it gives me a 404. Even tho I know that Lemmy.ml has a pictrs server.

What is the best way to determine if a Lemmy server has pictrs?

 

cross-posted from: https://eventfrontier.com/post/177049

I keep getting an error ValueError: perm should have the same length as rank(x): 3 != 2 when trying to convert my model using coremltools.

From my understanding the most common case for this is when your input shape that you pass into coremltools doesn't match your model input shape. However, as far as I can tell in my code it does match. I also added an input layer, and that didn't help either.

I have put a lot of effort into reducing my code as much as possible while still giving a minimal complete verifiable example. However, I'm aware that the code is still a lot. Starting at line 60 of my code is where I create my model, and train it.

I'm running this on Ubuntu, with NVIDIA setup with Docker.

Any ideas what I'm doing wrong?


from typing import TypedDict, Optional, List
import tensorflow as tf
import json
from tensorflow.keras.optimizers import Adam
import numpy as np
from sklearn.utils import resample
import keras
import coremltools as ct

# Simple tokenizer function
word_index = {}
index = 1
def tokenize(text: str) -> list:
    global word_index
    global index
    words = text.lower().split()
    sequences = []
    for word in words:
        if word not in word_index:
            word_index[word] = index
            index += 1
        sequences.append(word_index[word])
    return sequences

def detokenize(sequence: list) -> str:
    global word_index
    # Filter sequence to remove all 0s
    sequence = [int(index) for index in sequence if index != 0.0]
    words = [word for word, index in word_index.items() if index in sequence]
    return ' '.join(words)

# Pad sequences to the same length
def pad_sequences(sequences: list, max_len: int) -> list:
    padded_sequences = []
    for seq in sequences:
        if len(seq) > max_len:
            padded_sequences.append(seq[:max_len])
        else:
            padded_sequences.append(seq + [0] * (max_len - len(seq)))
    return padded_sequences

class PreprocessDataResult(TypedDict):
    inputs: tf.Tensor
    labels: tf.Tensor
    max_len: int

def preprocess_data(texts: List[str], labels: List[int], max_len: Optional[int] = None) -> PreprocessDataResult:
    tokenized_texts = [tokenize(text) for text in texts]
    if max_len is None:
        max_len = max(len(seq) for seq in tokenized_texts)
    padded_texts = pad_sequences(tokenized_texts, max_len)

    return PreprocessDataResult({
        'inputs': tf.convert_to_tensor(np.array(padded_texts, dtype=np.float32)),
        'labels': tf.convert_to_tensor(np.array(labels, dtype=np.int32)),
        'max_len': max_len
    })

# Define your model architecture
def create_model(input_shape: int) -> keras.models.Sequential:
    model = keras.models.Sequential()

    model.add(keras.layers.Input(shape=(input_shape,), dtype='int32', name='embedding_input'))
    model.add(keras.layers.Embedding(input_dim=10000, output_dim=128)) # `input_dim` represents the size of the vocabulary (i.e. the number of unique words in the dataset).
    model.add(keras.layers.Bidirectional(keras.layers.LSTM(units=64, return_sequences=True)))
    model.add(keras.layers.Bidirectional(keras.layers.LSTM(units=32)))
    model.add(keras.layers.Dense(units=64, activation='relu'))
    model.add(keras.layers.Dropout(rate=0.5))
    model.add(keras.layers.Dense(units=1, activation='sigmoid')) # Output layer, binary classification (meaning it outputs a 0 or 1, false or true). The sigmoid function outputs a value between 0 and 1, which can be interpreted as a probability.

    model.compile(
        optimizer=Adam(),
        loss='binary_crossentropy',
        metrics=['accuracy']
    )

    return model

# Train the model
def train_model(
    model: tf.keras.models.Sequential,
    train_data: tf.Tensor,
    train_labels: tf.Tensor,
    epochs: int,
    batch_size: int
) -> tf.keras.callbacks.History:
    return model.fit(
        train_data,
        train_labels,
        epochs=epochs,
        batch_size=batch_size,
        callbacks=[
            keras.callbacks.EarlyStopping(monitor='val_accuracy', patience=5),
            keras.callbacks.TensorBoard(log_dir='./logs', histogram_freq=1),
            # When downgrading from TensorFlow 2.18.0 to 2.12.0 I had to change this from `./best_model.keras` to `./best_model.tf`
            keras.callbacks.ModelCheckpoint(filepath='./best_model.tf', monitor='val_accuracy', save_best_only=True)
        ]
    )

# Example usage
if __name__ == "__main__":
    # Check available devices
    print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

    with tf.device('/GPU:0'):
        print("Loading data...")
        data = (["I love this!", "I hate this!"], [0, 1])
        rawTexts = data[0]
        rawLabels = data[1]

        # Preprocess data
        processedData = preprocess_data(rawTexts, rawLabels)
        inputs = processedData['inputs']
        labels = processedData['labels']
        max_len = processedData['max_len']

        print("Data loaded. Max length: ", max_len)

        # Save word_index to a file
        with open('./word_index.json', 'w') as file:
            json.dump(word_index, file)

        model = create_model(max_len)

        print('Training model...')
        train_model(model, inputs, labels, epochs=1, batch_size=32)
        print('Model trained.')

        # When downgrading from TensorFlow 2.18.0 to 2.12.0 I had to change this from `./best_model.keras` to `./best_model.tf`
        model.load_weights('./best_model.tf')
        print('Best model weights loaded.')

        # Save model
        # I think that .h5 extension allows for converting to CoreML, whereas .keras file extension does not
        model.save('./toxic_comment_analysis_model.h5')
        print('Model saved.')

        my_saved_model = tf.keras.models.load_model('./toxic_comment_analysis_model.h5')
        print('Model loaded.')

        print("Making prediction...")
        test_string = "Thank you. I really appreciate it."
        tokenized_string = tokenize(test_string)
        padded_texts = pad_sequences([tokenized_string], max_len)
        tensor = tf.convert_to_tensor(np.array(padded_texts, dtype=np.float32))
        predictions = my_saved_model.predict(tensor)
        print(predictions)
        print("Prediction made.")


        # Convert the Keras model to Core ML
        coreml_model = ct.convert(
            my_saved_model,
            inputs=[ct.TensorType(shape=(max_len,), name="embedding_input", dtype=np.int32)],
            source="tensorflow"
        )

        # Save the Core ML model
        coreml_model.save('toxic_comment_analysis_model.mlmodel')
        print("Model successfully converted to Core ML format.")

Code including Dockerfile & start script as GitHub Gist: https://gist.github.com/fishcharlie/af74d767a3ba1ffbf18cbc6d6a131089

view more: next ›